:root {
    color-scheme: light;
    --bg: #f6f7fb;
    --panel: #ffffff;
    --panel-strong: #fbfcff;
    --line: #dde2ec;
    --line-strong: #c7d0dd;
    --text: #1a2233;
    --muted: #687388;
    --accent: #2f6fed;
    --accent-soft: #e9f0ff;
    --scrollbar-track: #e7edf7;
    --scrollbar-thumb: #a8bcdf;
    --scrollbar-thumb-hover: #7f9fcc;
    --shadow: 0 20px 50px rgba(33, 49, 81, 0.08);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --max-width: 1240px;
    --card-width: 220px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, 0.08), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 46%, #eef1f6 100%);
}

html {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
    border: 3px solid var(--scrollbar-track);
    border-radius: 999px;
    background: var(--scrollbar-thumb);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.shell {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.floating-menu {
    position: fixed;
    top: 28px;
    left: 18px;
    z-index: 40;
    display: grid;
    gap: 12px;
    align-items: start;
    pointer-events: none;
}

.floating-menu__toggle {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 34px rgba(25, 40, 68, 0.16);
    color: var(--text);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.floating-menu__toggle:hover,
.floating-menu__toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 20px 36px rgba(25, 40, 68, 0.2);
    border-color: var(--line-strong);
    outline: none;
}

.floating-menu.is-edit-compact:not(.is-open) .floating-menu__toggle {
    transform: translateX(calc(-50% + 2px));
}

.floating-menu.is-edit-compact:not(.is-open) .floating-menu__toggle:hover,
.floating-menu.is-edit-compact:not(.is-open) .floating-menu__toggle:focus-visible {
    transform: translateY(-1px);
}

.floating-menu__toggle-lines,
.floating-menu__toggle-lines::before,
.floating-menu__toggle-lines::after {
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
    content: "";
    display: block;
}

.floating-menu__toggle-lines {
    position: relative;
}

.floating-menu__toggle-lines::before {
    position: absolute;
    top: -7px;
    left: 0;
}

.floating-menu__toggle-lines::after {
    position: absolute;
    top: 7px;
    left: 0;
}

.floating-menu.is-open .floating-menu__toggle-lines {
    background: transparent;
}

.floating-menu.is-open .floating-menu__toggle-lines::before {
    transform: translateY(7px) rotate(45deg);
}

.floating-menu.is-open .floating-menu__toggle-lines::after {
    transform: translateY(-7px) rotate(-45deg);
}

.floating-menu.is-edit-compact:not(.is-open) .floating-menu__toggle:not(:hover):not(:focus-visible) .floating-menu__toggle-lines {
    width: 0;
    background: transparent;
}

.floating-menu.is-edit-compact:not(.is-open) .floating-menu__toggle:not(:hover):not(:focus-visible) .floating-menu__toggle-lines::before,
.floating-menu.is-edit-compact:not(.is-open) .floating-menu__toggle:not(:hover):not(:focus-visible) .floating-menu__toggle-lines::after {
    width: 12px;
    left: 6px;
}

.floating-menu.is-edit-compact:not(.is-open) .floating-menu__toggle:not(:hover):not(:focus-visible) .floating-menu__toggle-lines::before {
    top: -4px;
    transform: rotate(45deg);
}

.floating-menu.is-edit-compact:not(.is-open) .floating-menu__toggle:not(:hover):not(:focus-visible) .floating-menu__toggle-lines::after {
    top: 4px;
    transform: rotate(-45deg);
}

.floating-menu__panel {
    width: min(280px, calc(100vw - 36px));
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 22px 46px rgba(25, 40, 68, 0.16);
    backdrop-filter: blur(16px);
    pointer-events: none;
    transform-origin: 30px -42px;
    transform: translateY(-8px) scale(0.4);
    opacity: 0;
    visibility: hidden;
    transition: transform 220ms cubic-bezier(0.2, 0.84, 0.24, 1), opacity 180ms ease, visibility 0s linear 220ms;
}

.floating-menu__panel.is-hidden {
    display: block !important;
}

.floating-menu.is-open .floating-menu__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 240ms cubic-bezier(0.18, 0.9, 0.22, 1), opacity 180ms ease;
}

.floating-menu__label {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.floating-menu__title {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.floating-menu__description {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.floating-menu__status {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--accent-soft);
    color: #264798;
    font-size: 13px;
    line-height: 1.7;
}

.floating-menu__actions {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.floating-menu__action {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.floating-menu__action-copy {
    display: grid;
    gap: 3px;
    justify-items: start;
    text-align: left;
}

.floating-menu__action-title {
    font-size: 15px;
    line-height: 1.2;
}

.floating-menu__action-meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.floating-menu__action:hover,
.floating-menu__action:focus-visible {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: 0 12px 24px rgba(25, 40, 68, 0.1);
    outline: none;
}

.floating-menu__action.is-active {
    border-color: transparent;
    background: linear-gradient(180deg, #4b79f2 0%, #355dd1 100%);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(53, 93, 209, 0.24);
}

.floating-menu__action.is-active .floating-menu__action-meta {
    color: rgba(255, 255, 255, 0.82);
}

.floating-menu__action::after {
    content: ">";
    color: var(--muted);
    font-size: 14px;
}

.floating-menu__action--placeholder {
    background: #f8faff;
    color: #56657f;
    cursor: default;
}

.floating-menu__action--placeholder::after {
    content: "準備中";
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.floating-menu__action:disabled {
    opacity: 0.82;
    box-shadow: none;
}

.settings-panel {
    width: min(100%, 760px);
}

.settings-panel__body {
    display: grid;
    gap: 18px;
}

.settings-panel__section {
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);

.settings-transfer__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
    border-radius: 24px;
    background: var(--panel-strong);
}

.settings-panel__section h4 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.settings-panel__section p,
.settings-panel__helper {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.theme-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.theme-option {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.theme-option:hover,
.theme-option:focus-visible {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: 0 12px 24px rgba(25, 40, 68, 0.1);
    outline: none;
}

.theme-option.is-active {
    border-color: color-mix(in srgb, var(--accent) 55%, #ffffff 45%);
    box-shadow: 0 14px 28px color-mix(in srgb, var(--accent) 18%, transparent 82%);
}

.theme-option__preview {
    display: block;
    height: 88px;
    border-radius: 16px;
    border: 1px solid rgba(207, 216, 232, 0.9);
    background: linear-gradient(135deg, #ffffff 0%, #edf3ff 52%, #d4e4ff 100%);
}

.theme-option[data-theme-option="night"] .theme-option__preview {
    background:
        radial-gradient(circle at 24% 20%, rgba(120, 168, 255, 0.26), transparent 28%),
        linear-gradient(135deg, #07111e 0%, #0c1c33 50%, #21416d 100%);
}

.theme-option[data-theme-option="border"] .theme-option__preview {
    background:
        repeating-linear-gradient(135deg, #ffffff 0 16px, #dff6ff 16px 32px),
        linear-gradient(135deg, rgba(72, 171, 215, 0.12), rgba(255, 255, 255, 0.92));
}

.theme-option[data-theme-option="aquamarine"] .theme-option__preview {
    background:
        radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.58), transparent 24%),
        linear-gradient(135deg, #e5fbf6 0%, #95eadf 46%, #42c8b9 100%);
}

.theme-option[data-theme-option="back"] .theme-option__preview {
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g transform='translate(40 40)'><path d='M0 -15l4.5 9h9.5l-7.5 7 2.5 9.5-8.5-6-8.5 6 2.5-9.5-7.5-7h9.5z' fill='%237ba093'/></g><g transform='translate(120 40)'><path d='M0 -15l4.5 9h9.5l-7.5 7 2.5 9.5-8.5-6-8.5 6 2.5-9.5-7.5-7h9.5z' fill='%238abb8e'/></g><g transform='translate(40 120)'><path d='M0 -15l4.5 9h9.5l-7.5 7 2.5 9.5-8.5-6-8.5 6 2.5-9.5-7.5-7h9.5z' fill='%238abb8e'/></g><g transform='translate(120 120)'><path d='M0 -15l4.5 9h9.5l-7.5 7 2.5 9.5-8.5-6-8.5 6 2.5-9.5-7.5-7h9.5z' fill='%237ba093'/></g></svg>"),
        linear-gradient(180deg, #6e9c96 0%, #a4de88 100%);
    background-size: 160px 160px, 100% 100%;
    background-repeat: repeat, no-repeat;
}

@keyframes back-theme-stars {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 160px 160px, 0 0;
    }
}

.theme-option__body {
    display: grid;
    gap: 8px;
}

.theme-option__name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.theme-option__name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.theme-option__status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.theme-option__description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
}

.hero {
    position: relative;
    overflow: visible;
    margin-bottom: 24px;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at calc(100% + 64px) calc(100% + 96px), rgba(47, 111, 237, 0.11), transparent 42%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.95)),
        var(--panel);
    box-shadow: var(--shadow);
}

.hero::after {
    display: none;
}

.hero__eyebrow {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
}

.hero__title {
    margin: 0;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero__description {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.9;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero__toolbar {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
}

.hero__toolbar .catalog-search {
    flex: 1 1 440px;
    width: min(100%, 560px);
    margin-top: 0;
}

.hero__toolbar .option-trigger {
    min-height: 58px;
    padding: 0 20px;
}

.hero__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--muted);
    font-size: 14px;
}

.hero__pill strong {
    color: var(--text);
    font-size: 16px;
}

.view {
    display: none;
}

.view.is-active {
    display: block;
}

.section-card {
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}

.section-head__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.section-head__status {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.section-head__status strong {
    margin-left: 8px;
    color: var(--text);
    font-size: 14px;
}

.catalog-search {
    position: relative;
    width: min(100%, 440px);
    margin-top: 18px;
}

.catalog-search__combobox {
    position: relative;
}

.catalog-search__field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 16px 0 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 74%, #ffffff 26%);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 36px rgba(25, 40, 68, 0.12);
    transition: border-radius 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.catalog-search.is-open .catalog-search__field {
    border-radius: 28px 28px 0 0;
    box-shadow: 0 10px 18px rgba(25, 40, 68, 0.08);
}

.catalog-search__field:focus-within {
    border-color: color-mix(in srgb, var(--accent) 88%, #ffffff 12%);
}

.catalog-search__input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    line-height: 1.4;
}

.catalog-search__input::placeholder {
    color: color-mix(in srgb, var(--muted) 88%, #ffffff 12%);
}

.catalog-search__input:focus {
    outline: none;
}

.catalog-search__clear,
.catalog-search__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
}

.catalog-search__clear {
    border: none;
    background: rgba(255, 255, 255, 0.86);
    color: var(--muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.catalog-search__clear:hover,
.catalog-search__clear:focus-visible {
    color: var(--text);
    outline: none;
}

.catalog-search__submit {
    border: none;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.catalog-search__submit:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent 68%);
}

.catalog-search__submit svg {
    width: 24px;
    height: 24px;
    display: block;
}

.catalog-search__autocomplete {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    z-index: 24;
    max-height: 320px;
    border: 1px solid color-mix(in srgb, var(--accent) 74%, #ffffff 26%);
    border-top: none;
    border-radius: 0 0 28px 28px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 44px rgba(25, 40, 68, 0.16);
    overflow-x: hidden;
    overflow-y: auto;
}

.catalog-search__suggestion,
.catalog-search__empty {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-top: 1px solid rgba(207, 216, 232, 0.56);
    background: transparent;
    text-align: left;
}

.catalog-search__suggestion {
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.catalog-search__suggestion:hover,
.catalog-search__suggestion:focus-visible,
.catalog-search__suggestion.is-active {
    background: color-mix(in srgb, var(--accent-soft) 86%, #ffffff 14%);
    outline: none;
}

.catalog-search__suggestion-line {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 1.65;
    word-break: break-word;
}

.catalog-search__suggestion-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.catalog-search__mark {
    padding: 0 0.08em;
    border-radius: 0.2em;
    background: color-mix(in srgb, #ffe45a 88%, #ffffff 12%);
    color: inherit;
}

.catalog-search__suggestion-secondary,
.catalog-search__empty {
    color: var(--muted);
}

.option-trigger {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.option-trigger:hover,
.option-trigger:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(47, 111, 237, 0.25);
    outline: none;
}

.section-head h2,
.detail-header__copy h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.section-head p,
.detail-header__copy p,
.detail-summary,
.empty-state p,
.status-box p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-width), var(--card-width)));
    justify-content: center;
    gap: 18px;
}

.catalog-edit-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    position: sticky;
    top: 18px;
    z-index: 18;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(47, 111, 237, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(233, 240, 255, 0.92) 0%, rgba(255, 255, 255, 0.96) 100%);
    box-shadow: 0 16px 30px rgba(33, 49, 81, 0.08);
    backdrop-filter: blur(10px);
}

.catalog-edit-bar__copy {
    display: grid;
    gap: 4px;
}

.catalog-edit-bar__count {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.catalog-edit-bar__helper {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.catalog-edit-bar__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.catalog-edit-bar__button {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.catalog-edit-bar__button:hover,
.catalog-edit-bar__button:focus-visible {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: 0 12px 24px rgba(25, 40, 68, 0.1);
    outline: none;
}

.catalog-edit-bar__button--primary {
    border-color: transparent;
    background: linear-gradient(180deg, #4b79f2 0%, #355dd1 100%);
    color: #ffffff;
}

.catalog-edit-bar__button.is-active {
    border-color: transparent;
    background: linear-gradient(180deg, #4b79f2 0%, #355dd1 100%);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(53, 93, 209, 0.22);
}

.catalog-edit-bar__button:disabled {
    opacity: 0.48;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.catalog-empty {
    margin-top: 18px;
}

.character-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 14px;
    width: min(100%, var(--card-width));
    padding-top: 18px;
    padding-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: 0 12px 30px rgba(31, 44, 71, 0.08);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    text-align: left;
}

.character-card.is-selected {
    border-color: rgba(47, 111, 237, 0.45);
    box-shadow: 0 22px 42px rgba(47, 111, 237, 0.18);
}

.character-card.is-edit-mode {
    cursor: pointer;
}

.character-card.is-card-reorder-mode {
    cursor: grab;
}

.character-card.is-card-reorder-mode:active {
    cursor: grabbing;
}

.character-card.is-card-reorder-mode.is-dragging {
    opacity: 0.42;
    border-style: dashed;
}

.character-card.is-edit-mode:hover,
.character-card.is-edit-mode:focus-visible {
    border-color: rgba(47, 111, 237, 0.42);
}

.character-card:hover,
.character-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: 0 18px 36px rgba(31, 44, 71, 0.12);
    outline: none;
}

.character-card__visual,
.detail-visual {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at top, rgba(47, 111, 237, 0.12), transparent 58%),
        linear-gradient(180deg, #eef4ff 0%, #f7f9fd 100%);
}

.character-card__visual {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.95);
    overflow: visible;
}

.character-card__overlay {
    position: absolute;
    left: -10px;
    z-index: 3;
    display: flex;
    gap: 8px;
    pointer-events: none;
}

.character-card__overlay--top-left {
    top: -10px;
}

.character-card__overlay--top-left[data-weapon-indicator] {
    pointer-events: auto;
}

.character-card__overlay--bottom-left {
    bottom: -10px;
}

.character-card__selection {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: rgba(104, 115, 136, 0.54);
    box-shadow: 0 10px 20px rgba(25, 40, 68, 0.12);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 140ms ease, transform 140ms ease, background 140ms ease, color 140ms ease;
    pointer-events: none;
}

.character-card.is-edit-mode .character-card__selection {
    opacity: 1;
    transform: scale(1);
}

.character-card.is-selected .character-card__selection {
    background: linear-gradient(180deg, #4b79f2 0%, #355dd1 100%);
    color: #ffffff;
}

.character-card__selection svg {
    width: 18px;
    height: 18px;
    display: block;
}

.character-card__reorder-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    box-shadow: 0 10px 18px rgba(25, 40, 68, 0.12);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease;
    pointer-events: none;
}

.character-card.is-card-reorder-mode .character-card__reorder-indicator {
    opacity: 1;
    transform: translateY(0);
}

.character-card.is-card-reorder-mode .character-card__selection {
    opacity: 0;
    transform: scale(0.84);
}

.character-card--drop-placeholder {
    position: relative;
    pointer-events: none;
    cursor: default;
    border-style: dashed;
    border-color: color-mix(in srgb, var(--accent) 54%, #ffffff 46%);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 255, 0.98));
    box-shadow: 0 16px 30px rgba(47, 111, 237, 0.1);
    overflow: hidden;
}

.character-card--drop-placeholder::before {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(47, 111, 237, 0.14), rgba(47, 111, 237, 0.08)),
        linear-gradient(90deg, rgba(47, 111, 237, 0.18), rgba(47, 111, 237, 0.18)),
        linear-gradient(90deg, rgba(47, 111, 237, 0.12), rgba(47, 111, 237, 0.12));
    background-repeat: no-repeat;
    background-size:
        100% calc(100% - 74px),
        42% 10px,
        24% 10px;
    background-position:
        0 0,
        0 calc(100% - 34px),
        0 calc(100% - 16px);
    opacity: 0.82;
}

.character-card--drop-placeholder::after {
    content: "ここに移動";
    position: absolute;
    top: 26px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.character-card__badge {
    display: block;
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 8px 14px rgba(18, 33, 58, 0.28));
}

.character-card__badge[data-card-focus] {
    cursor: pointer;
    pointer-events: auto;
}

.character-card__badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.character-card__image,
.detail-visual__image {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
}

.character-card__image,
.character-card__placeholder {
    border-radius: inherit;
}

.detail-visual__image {
    background-size: contain;
    background-position: center center;
}

.character-card__placeholder,
.detail-visual__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    text-align: center;
    color: #7b879b;
    font-weight: 700;
    letter-spacing: 0.06em;
    background:
        radial-gradient(circle at top, rgba(47, 111, 237, 0.12), transparent 52%),
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.95) 0,
            rgba(255, 255, 255, 0.95) 16px,
            rgba(232, 238, 248, 0.95) 16px,
            rgba(232, 238, 248, 0.95) 32px
        );
}

.character-card__placeholder {
    color: transparent;
}

.detail-visual__placeholder {
    font-size: 20px;
}

.character-card__body {
    display: grid;
    gap: 6px;
    align-content: start;
}

.character-card__title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.character-card__title {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.character-card__id,
.detail-header__id {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.character-card__kana,
.detail-header__kana {
    color: var(--muted);
    font-size: 13px;
}

.character-card__copy {
    display: grid;
    gap: 4px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #264798;
    font-size: 12px;
    font-weight: 700;
}

.tag img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.detail-page {
    display: grid;
    gap: 18px;
}

.back-button,
.shape-tab {
    appearance: none;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    font-weight: 700;
}

.back-button:hover,
.back-button:focus-visible,
.shape-tab:hover,
.shape-tab:focus-visible {
    border-color: var(--line-strong);
    outline: none;
}

.detail-header {
    display: grid;
    grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.detail-visual {
    min-height: 440px;
    border: 1px solid rgba(255, 255, 255, 0.95);
}

.detail-visual__badge {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 1;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.detail-header__panel {
    display: grid;
    gap: 18px;
    align-content: start;
    padding: 8px 0;
}

.detail-header__title-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.detail-summary {
    font-size: 15px;
}

.detail-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.favorite-button {
    appearance: none;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.favorite-button:hover,
.favorite-button:focus-visible {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: 0 12px 24px rgba(25, 40, 68, 0.1);
    outline: none;
}

.favorite-button.is-active {
    border-color: transparent;
    background: linear-gradient(180deg, #ffd97d 0%, #ffbf45 100%);
    color: #5f3a00;
    box-shadow: 0 16px 28px rgba(255, 191, 69, 0.22);
}

.detail-custom-tags {
    display: grid;
    gap: 10px;
}

.detail-custom-tags__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-custom-tags__header strong {
    font-size: 14px;
    letter-spacing: -0.01em;
}

.detail-custom-tags__empty {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.detail-custom-tags__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.detail-custom-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 38px;
    align-items: center;
}

.detail-custom-tags__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.detail-custom-tags__add:hover,
.detail-custom-tags__add:focus-visible {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.detail-custom-tags__add-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.floating-menu.is-detail-hidden {
    display: none;
}

.custom-tag-assignment {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.custom-tag-chip,
.custom-tag-toggle {
    --tag-color: #5ea0ff;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--tag-color) 34%, #d8deeb 66%);
    background: color-mix(in srgb, var(--tag-color) 16%, #ffffff 84%);
    color: color-mix(in srgb, var(--tag-color) 58%, #1a2233 42%);
    font-weight: 700;
}

.custom-tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.custom-tag-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.custom-tag-toggle__label {
    display: block;
}

.custom-tag-toggle__check {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tag-color) 72%, #ffffff 28%);
    color: #ffffff;
    box-shadow: 0 0 0 2px #ffffff;
    pointer-events: none;
}

.custom-tag-toggle__check svg {
    width: 12px;
    height: 12px;
    display: block;
}

.custom-tag-toggle:hover,
.custom-tag-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(25, 40, 68, 0.08);
    outline: none;
}

.custom-tag-toggle.is-active {
    background: color-mix(in srgb, var(--tag-color) 24%, #ffffff 76%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-color) 55%, #ffffff 45%);
}

.custom-tag-toggle.is-mixed {
    background: repeating-linear-gradient(
        135deg,
        color-mix(in srgb, var(--tag-color) 22%, #ffffff 78%) 0,
        color-mix(in srgb, var(--tag-color) 22%, #ffffff 78%) 10px,
        #ffffff 10px,
        #ffffff 20px
    );
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-color) 48%, #ffffff 52%);
}

.custom-tag-input,
.custom-tag-color {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
}

.custom-tag-color-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.custom-tag-color {
    padding: 6px;
    cursor: pointer;
}

.custom-tag-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.custom-tag-preview-swatch {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    background: var(--tag-preview-color, #5ea0ff);
}

.custom-tag-manager__list {
    display: grid;
    gap: 12px;
}

.custom-tag-manager__item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 18px;
    background: #ffffff;
}

.custom-tag-manager__item.is-dragging {
    opacity: 0.42;
    border-style: dashed;
}

.custom-tag-manager__item::before,
.custom-tag-manager__item::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 24%, transparent 76%);
    border: 1px dashed color-mix(in srgb, var(--accent) 58%, #ffffff 42%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}

.custom-tag-manager__item::before {
    top: -8px;
}

.custom-tag-manager__item::after {
    bottom: -8px;
}

.custom-tag-manager__item.is-drop-before::before,
.custom-tag-manager__item.is-drop-after::after {
    opacity: 1;
}

.custom-tag-manager__meta {
    display: grid;
    gap: 8px;
}

.custom-tag-manager__note {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.custom-tag-manager__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.custom-tag-manager__button {
    min-width: 42px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 12px;
    background: #f8faff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.custom-tag-manager__button:disabled {
    opacity: 0.4;
    cursor: default;
}

.custom-tag-manager__drag {
    position: relative;
    min-width: 44px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px dashed rgba(207, 216, 232, 0.96);
    border-radius: 12px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 700;
    cursor: grab;
}

.custom-tag-manager__drag::after {
    content: attr(data-drag-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(26, 34, 51, 0.92);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(25, 40, 68, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
}

.custom-tag-manager__drag::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    width: 8px;
    height: 8px;
    background: rgba(26, 34, 51, 0.92);
    transform: translateX(-50%) rotate(45deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
}

.custom-tag-manager__drag:hover::after,
.custom-tag-manager__drag:hover::before,
.custom-tag-manager__drag:focus-visible::after,
.custom-tag-manager__drag:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.custom-tag-manager__drag:active {
    cursor: grabbing;
}

.custom-tag-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.custom-tag-random-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.custom-tag-random-button svg {
    width: 18px;
    height: 18px;
    display: block;
}

.custom-tag-panel__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shape-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shape-tab {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--muted);
    background: #f8faff;
}

.shape-tab.is-active {
    border-color: transparent;
    background: var(--accent);
    color: #ffffff;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.95fr);
    gap: 18px;
}

.detail-block {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-strong);
}

.detail-block h3 {
    margin: 0 0 14px;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.detail-description {
    color: var(--text);
    line-height: 1.95;
}

.info-list {
    display: grid;
    gap: 12px;
}

.info-list__row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(199, 208, 221, 0.56);
}

.info-list__row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.info-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.info-list dd {
    margin: 0;
    line-height: 1.8;
}

.skill-list {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.skill-card {
    padding: 16px;
    border: 1px solid rgba(199, 208, 221, 0.62);
    border-radius: 18px;
    background: #ffffff;
}

.skill-card h4 {
    margin: 0 0 8px;
    font-size: 15px;
}

.skill-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.weapon-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.weapon-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(199, 208, 221, 0.62);
    border-radius: 20px;
    background: #ffffff;
}

.weapon-card__media {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(214, 221, 234, 0.92);
    background:
        radial-gradient(circle at top, rgba(47, 111, 237, 0.12), transparent 58%),
        linear-gradient(180deg, #f4f7ff 0%, #fbfcff 100%);
}

.weapon-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 8px 14px rgba(18, 33, 58, 0.18));
}

.weapon-card__placeholder {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: center;
}

.weapon-card__body {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.weapon-card__body h4 {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    word-break: break-word;
}

.weapon-card__body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.empty-state,
.status-box {
    display: grid;
    justify-items: start;
    gap: 10px;
    padding: 22px;
    border: 1px dashed var(--line-strong);
    border-radius: 20px;
    background: rgba(249, 251, 255, 0.86);
}

.empty-state h3,
.status-box h2 {
    margin: 0;
    font-size: 18px;
}

.option-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(244, 247, 252, 0.76);
    backdrop-filter: blur(12px);
}

.option-panel {
    width: min(100%, 940px);
    max-height: min(92vh, 760px);
    overflow: auto;
    padding: 16px;
    border: 1px solid rgba(188, 199, 220, 0.9);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
    color: var(--text);
    box-shadow: 0 28px 72px rgba(33, 49, 81, 0.18);
}

.option-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.option-panel__header h3 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.03em;
}

.option-panel__header p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.option-panel__close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--accent);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.option-panel__tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 18px;
    padding: 1px;
    border-radius: 18px 18px 0 0;
    background: rgba(208, 218, 235, 0.9);
}

.option-tab {
    min-height: 50px;
    border: none;
    border-radius: 16px 16px 0 0;
    background: rgba(243, 246, 252, 0.98);
    color: #5270a9;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.option-tab.is-active {
    background: #ffffff;
    color: var(--accent);
    box-shadow: inset 0 -2px 0 #5ea0ff;
}

.option-panel__workspace {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 0;
    min-height: 360px;
}

.option-panel__workspace.is-sort-mode {
    grid-template-columns: 1fr;
}

.option-panel__workspace.is-sort-mode .option-panel__main {
    padding: 0;
}

.option-categories {
    display: grid;
    align-content: start;
    border-right: 1px solid rgba(208, 218, 235, 0.95);
}

.option-category {
    min-height: 52px;
    padding: 0 16px;
    border: none;
    border-bottom: 1px solid rgba(208, 218, 235, 0.95);
    background: transparent;
    color: #52617f;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.option-category.is-active {
    background: rgba(233, 240, 255, 0.96);
    color: var(--accent);
    box-shadow: inset 3px 0 0 #5ea0ff;
}

.option-category.is-disabled {
    opacity: 0.58;
}

.option-panel__main {
    display: grid;
    align-content: start;
    gap: 18px;
    padding: 18px 0 0 18px;
}

.option-panel__main h4 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.option-panel__main p,
.option-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.option-block {
    display: grid;
    gap: 10px;
}

.option-label {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.option-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option-chip {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 999px;
    background: #ffffff;
    color: #4a5878;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.option-chip:hover,
.option-chip:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.option-chip.is-active {
    border-color: #bdd0ff;
    background: #e9f0ff;
    color: #27458d;
}

.option-chip.is-secondary {
    background: #f7f9fc;
    color: #7b879b;
}

.option-panel__footer {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.option-action {
    min-height: 46px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.option-action--primary {
    background: linear-gradient(180deg, #4b79f2 0%, #355dd1 100%);
    border-color: transparent;
    color: #ffffff;
}

.option-action:disabled {
    opacity: 0.48;
    cursor: default;
}

.character-context-menu {
    position: fixed;
    z-index: 260;
    width: min(280px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid rgba(188, 199, 220, 0.9);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
    color: var(--text);
    box-shadow: 0 24px 60px rgba(33, 49, 81, 0.24);
}

.character-context-menu__header {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    padding: 4px 6px 10px;
    border-bottom: 1px solid rgba(208, 218, 235, 0.92);
}

.character-context-menu__label {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.character-context-menu__title {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
}

.character-context-menu__meta,
.character-context-menu__helper {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.character-context-menu__actions {
    display: grid;
    gap: 8px;
}

.character-context-menu__action {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.character-context-menu__action:hover,
.character-context-menu__action:focus-visible {
    transform: translateY(-1px);
    outline: none;
    background: #eef4ff;
    color: var(--accent);
}

.character-context-menu__action:disabled {
    opacity: 0.52;
    cursor: default;
    transform: none;
    background: #f7f9fc;
    color: #7b879b;
}

.character-context-menu__helper {
    margin-top: 10px;
    padding: 0 6px;
}

.notification-banner {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 280;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    padding: 14px 16px;
    border: 1px solid rgba(188, 199, 220, 0.94);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
    color: var(--text);
    box-shadow: 0 24px 56px rgba(33, 49, 81, 0.22);
}

.notification-banner[data-tone="success"] {
    border-color: rgba(112, 198, 164, 0.72);
}

.notification-banner[data-tone="error"] {
    border-color: rgba(225, 120, 120, 0.74);
}

.notification-banner__body {
    min-width: 0;
    flex: 1;
}

.notification-banner__message {
    margin: 0;
    line-height: 1.6;
    font-size: 14px;
    font-weight: 700;
}

.notification-banner__close {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 1px solid rgba(207, 216, 232, 0.96);
    border-radius: 999px;
    background: #ffffff;
    color: var(--accent);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.notification-banner__close:hover,
.notification-banner__close:focus-visible {
    outline: none;
    transform: translateY(-1px);
}

.is-hidden {
    display: none !important;
}

body[data-theme] .hero,
body[data-theme] .section-card,
body[data-theme] .option-panel,
body[data-theme] .settings-panel__section,
body[data-theme] .detail-block,
body[data-theme] .character-card,
body[data-theme] .skill-card,
body[data-theme] .weapon-card,
body[data-theme] .catalog-edit-bar,
body[data-theme] .custom-tag-manager__item,
body[data-theme] .floating-menu__panel,
body[data-theme] .character-context-menu,
body[data-theme] .notification-banner {
    border-color: color-mix(in srgb, var(--line) 92%, transparent 8%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, #ffffff 4%) 0%, color-mix(in srgb, var(--panel-strong) 94%, var(--panel) 6%) 100%);
    color: var(--text);
    box-shadow: var(--shadow);
}

body[data-theme] .hero {
    background:
        radial-gradient(circle at calc(100% + 64px) calc(100% + 96px), color-mix(in srgb, var(--accent) 18%, transparent 82%), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, #ffffff 4%) 0%, color-mix(in srgb, var(--panel-strong) 94%, var(--panel) 6%) 100%);
}

body[data-theme] .floating-menu__toggle,
body[data-theme] .floating-menu__action,
body[data-theme] .back-button,
body[data-theme] .shape-tab,
body[data-theme] .favorite-button,
body[data-theme] .detail-custom-tags__add,
body[data-theme] .custom-tag-manager__button,
body[data-theme] .custom-tag-manager__drag,
body[data-theme] .custom-tag-input,
body[data-theme] .custom-tag-color,
body[data-theme] .custom-tag-random-button,
body[data-theme] .option-chip,
body[data-theme] .character-context-menu__action,
body[data-theme] .notification-banner__close,
body[data-theme] .option-panel__close,
body[data-theme] .catalog-edit-bar__button,
body[data-theme] .theme-option,
body[data-theme] .catalog-search__field,
body[data-theme] .catalog-search__autocomplete,
body[data-theme] .catalog-search__clear,
body[data-theme] .catalog-search__submit {
    border-color: var(--line);
    background: var(--panel);
    color: var(--text);
}

body[data-theme] .hero__pill,
body[data-theme] .section-head__status,
body[data-theme] .detail-visual__badge {
    border-color: var(--line);
    background: color-mix(in srgb, var(--panel) 86%, transparent 14%);
    color: var(--muted);
}

body[data-theme] .option-chip.is-secondary,
body[data-theme] .shape-tab,
body[data-theme] .catalog-search__suggestion:hover,
body[data-theme] .catalog-search__suggestion:focus-visible,
body[data-theme] .catalog-search__suggestion.is-active {
    background: color-mix(in srgb, var(--panel-strong) 82%, var(--panel) 18%);
    color: var(--muted);
}

body[data-theme] .catalog-search__mark {
    background: color-mix(in srgb, var(--accent) 34%, #ffe45a 66%);
}

body[data-theme] .option-chip.is-active {
    border-color: color-mix(in srgb, var(--accent) 44%, #ffffff 56%);
    background: color-mix(in srgb, var(--accent-soft) 78%, var(--panel) 22%);
    color: var(--accent);
}

body[data-theme] .option-category,
body[data-theme] .option-tab {
    background: color-mix(in srgb, var(--panel-strong) 78%, var(--panel) 22%);
    color: var(--muted);
}

body[data-theme] .option-tab.is-active {
    background: var(--panel);
    color: var(--accent);
    box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent) 88%, #ffffff 12%);
}

body[data-theme] .option-category.is-active {
    background: color-mix(in srgb, var(--accent-soft) 82%, var(--panel) 18%);
    color: var(--accent);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 88%, #ffffff 12%);
}

body[data-theme] .option-panel__tabs {
    background: color-mix(in srgb, var(--line) 86%, transparent 14%);
}

body[data-theme] .option-categories {
    border-right-color: color-mix(in srgb, var(--line) 92%, transparent 8%);
}

body[data-theme] .option-category {
    border-bottom-color: color-mix(in srgb, var(--line) 92%, transparent 8%);
}

body[data-theme] .weapon-card__media,
body[data-theme] .character-card__visual,
body[data-theme] .detail-visual {
    background:
        radial-gradient(circle at top, color-mix(in srgb, var(--accent) 18%, transparent 82%), transparent 58%),
        linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 28%, var(--panel-strong) 72%) 0%, var(--panel-strong) 100%);
}

body[data-theme] .empty-state,
body[data-theme] .status-box {
    border-color: color-mix(in srgb, var(--line-strong) 90%, transparent 10%);
    background: color-mix(in srgb, var(--panel-strong) 82%, transparent 18%);
}

body[data-theme] .character-card__placeholder,
body[data-theme] .detail-visual__placeholder {
    color: color-mix(in srgb, var(--muted) 92%, #ffffff 8%);
    background:
        radial-gradient(circle at top, color-mix(in srgb, var(--accent) 12%, transparent 88%), transparent 52%),
        repeating-linear-gradient(
            135deg,
            color-mix(in srgb, var(--panel) 92%, #ffffff 8%) 0,
            color-mix(in srgb, var(--panel) 92%, #ffffff 8%) 16px,
            color-mix(in srgb, var(--panel-strong) 90%, #ffffff 10%) 16px,
            color-mix(in srgb, var(--panel-strong) 90%, #ffffff 10%) 32px
        );
}

body[data-theme] .option-action--primary,
body[data-theme] .catalog-edit-bar__button--primary,
body[data-theme] .catalog-edit-bar__button.is-active,
body[data-theme] .floating-menu__action.is-active,
body[data-theme] .shape-tab.is-active {
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #ffffff 18%) 0%, color-mix(in srgb, var(--accent) 62%, #0f1320 38%) 100%);
    border-color: transparent;
    color: #ffffff;
}

body[data-theme] .option-overlay {
    background: color-mix(in srgb, var(--bg) 72%, rgba(6, 12, 24, 0.18) 28%);
}

body[data-theme="night"] {
    color-scheme: dark;
    --bg: #0c1730;
    --panel: #10203d;
    --panel-strong: #152947;
    --line: #243c62;
    --line-strong: #3c5f95;
    --text: #e7efff;
    --muted: #9db1d6;
    --accent: #72a8ff;
    --accent-soft: #183256;
    --scrollbar-track: #13233f;
    --scrollbar-thumb: #466caa;
    --scrollbar-thumb-hover: #6e9df0;
    --shadow: 0 26px 64px rgba(0, 8, 24, 0.42);
    background:
        radial-gradient(circle at top left, rgba(114, 168, 255, 0.16), transparent 24%),
        linear-gradient(180deg, #060e1a 0%, #091427 42%, #0e1c34 100%);
}

body[data-theme="night"] .floating-menu__toggle,
body[data-theme="night"] .floating-menu__action,
body[data-theme="night"] .back-button,
body[data-theme="night"] .shape-tab,
body[data-theme="night"] .favorite-button,
body[data-theme="night"] .detail-custom-tags__add,
body[data-theme="night"] .custom-tag-manager__button,
body[data-theme="night"] .custom-tag-manager__drag,
body[data-theme="night"] .custom-tag-input,
body[data-theme="night"] .custom-tag-color,
body[data-theme="night"] .custom-tag-random-button,
body[data-theme="night"] .option-chip,
body[data-theme="night"] .option-panel__close,
body[data-theme="night"] .catalog-edit-bar__button,
body[data-theme="night"] .theme-option {
    box-shadow: 0 14px 30px rgba(0, 8, 24, 0.2);
}

body[data-theme="night"] .option-overlay {
    background: rgba(4, 10, 20, 0.72);
}

body[data-theme="border"] {
    color-scheme: light;
    --bg: #effbff;
    --panel: #ffffff;
    --panel-strong: #f7fdff;
    --line: #cce9f4;
    --line-strong: #8ed3e8;
    --text: #153145;
    --muted: #5b7b8f;
    --accent: #4ab3da;
    --accent-soft: #e2f8ff;
    --scrollbar-track: #dff3fb;
    --scrollbar-thumb: #84cfe6;
    --scrollbar-thumb-hover: #58b8d8;
    --shadow: 0 20px 48px rgba(36, 111, 146, 0.12);
    background: repeating-linear-gradient(135deg, #ffffff 0 18px, #dff5ff 18px 36px);
}

body[data-theme="border"] .hero,
body[data-theme="border"] .section-card,
body[data-theme="border"] .option-panel,
body[data-theme="border"] .settings-panel__section,
body[data-theme="border"] .detail-block,
body[data-theme="border"] .character-card,
body[data-theme="border"] .skill-card,
body[data-theme="border"] .weapon-card,
body[data-theme="border"] .catalog-edit-bar,
body[data-theme="border"] .custom-tag-manager__item,
body[data-theme="border"] .floating-menu__panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 252, 255, 0.86) 100%);
}

body[data-theme="border"] .hero {
    background:
        radial-gradient(circle at calc(100% + 64px) calc(100% + 96px), rgba(74, 179, 218, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 252, 255, 0.86) 100%);
}

body[data-theme="aquamarine"] {
    color-scheme: light;
    --bg: #ebfaf7;
    --panel: #ffffff;
    --panel-strong: #f4fffc;
    --line: #cdeee7;
    --line-strong: #82d8cb;
    --text: #173434;
    --muted: #5b807c;
    --accent: #2dbba8;
    --accent-soft: #dff8f3;
    --scrollbar-track: #dbf3ed;
    --scrollbar-thumb: #7ad4c7;
    --scrollbar-thumb-hover: #38bba9;
    --shadow: 0 22px 52px rgba(25, 112, 101, 0.12);
    background:
        radial-gradient(circle at top left, rgba(45, 187, 168, 0.16), transparent 24%),
        linear-gradient(180deg, #fbfffe 0%, #e9faf7 46%, #daf5ef 100%);
}

body[data-theme="back"] {
    color-scheme: light;
    --bg: #a4de88;
    --panel: #f9fff8;
    --panel-strong: #f2fbf0;
    --line: #a8c8af;
    --line-strong: #6e9c96;
    --text: #26423b;
    --muted: #5e7c72;
    --accent: #6e9c96;
    --accent-soft: #dfeedd;
    --scrollbar-track: #dcecd5;
    --scrollbar-thumb: #8db19e;
    --scrollbar-thumb-hover: #6e9c96;
    --shadow: 0 22px 52px rgba(58, 98, 86, 0.16);
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g transform='translate(40 40)'><path d='M0 -15l4.5 9h9.5l-7.5 7 2.5 9.5-8.5-6-8.5 6 2.5-9.5-7.5-7h9.5z' fill='%237ba093'/></g><g transform='translate(120 40)'><path d='M0 -15l4.5 9h9.5l-7.5 7 2.5 9.5-8.5-6-8.5 6 2.5-9.5-7.5-7h9.5z' fill='%238abb8e'/></g><g transform='translate(40 120)'><path d='M0 -15l4.5 9h9.5l-7.5 7 2.5 9.5-8.5-6-8.5 6 2.5-9.5-7.5-7h9.5z' fill='%238abb8e'/></g><g transform='translate(120 120)'><path d='M0 -15l4.5 9h9.5l-7.5 7 2.5 9.5-8.5-6-8.5 6 2.5-9.5-7.5-7h9.5z' fill='%237ba093'/></g></svg>"),
        linear-gradient(180deg, #6e9c96 0%, #a4de88 100%);
    background-size: 160px 160px, 100% 100%;
    background-repeat: repeat, no-repeat;
    animation: back-theme-stars 4s linear infinite;
}

@media (max-width: 900px) {
    .floating-menu {
        top: 18px;
        left: 12px;
    }

    .detail-header,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-visual {
        min-height: 360px;
    }

    .settings-transfer__actions {
        grid-template-columns: 1fr;
    }

    .option-panel__workspace {
        grid-template-columns: 1fr;
    }

    .option-categories {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-right: none;
        border-bottom: 1px solid rgba(208, 218, 235, 0.95);
    }

    .option-category {
        min-height: 48px;
        border-right: 1px solid rgba(208, 218, 235, 0.95);
        text-align: center;
    }

    .option-panel__main {
        padding: 18px 0 0;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(calc(100% - 20px), var(--max-width));
        padding-top: 18px;
    }

    .floating-menu__toggle {
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    .floating-menu__panel {
        width: min(250px, calc(100vw - 24px));
        padding: 16px;
        border-radius: 20px;
    }

    .hero,
    .section-card {
        padding: 20px;
        border-radius: 22px;
    }

    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--card-width), var(--card-width)));
    }

    .character-card {
        grid-template-rows: auto 1fr;
        width: min(100%, var(--card-width));
    }

    .character-card__visual {
        width: 200px;
        height: 200px;
    }

    .info-list__row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .section-head__actions {
        justify-content: stretch;
    }

    .hero__toolbar {
        align-items: stretch;
    }

    .catalog-search {
        width: 100%;
    }

    .catalog-edit-bar {
        grid-template-columns: 1fr;
        top: 12px;
    }

    .catalog-edit-bar__actions {
        justify-content: stretch;
    }

    .catalog-edit-bar__button {
        width: 100%;
    }

    .option-trigger,
    .section-head__status {
        width: 100%;
        justify-content: center;
    }

    .option-overlay {
        padding: 12px;
    }

    .option-panel {
        padding: 12px;
    }

    .option-panel__tabs {
        grid-template-columns: 1fr;
        gap: 8px;
        background: transparent;
    }

    .option-tab {
        border-radius: 14px;
    }

    .option-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}