/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 全体 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/

/* --- Cyber Blue Theme --- */
html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Meiryo", 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #001e3c 0%, #003366 100%);
    margin: 0;
    overflow: hidden;
    width: 100%;
    height: 100svh;
/* 文字基本設定 */
    color: #e0f7fa;
    font-size: 0.9vw;
}

.is-hidden {
  display: none !important;
}

.is-visible {
  display: block !important;
}
/* リンクの基本設定 */
a {
    color: #00f0ff;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #fff;
    text-shadow: 0 0 8px #00f0ff, 0 0 2px #00a0ff;
}

/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ メインレイアウト ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
.main-layout {
    /* 計算方法の簡略化 widthなどがpaddingやborderを含むようになる */
    box-sizing: border-box;
    display: flex;
    width: 100%;
    height: 100%;
   /*height: calc(100% - 60px);*/
}


/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/

/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ メニュー ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
.menu {
    box-sizing: border-box;
    --menu-width: 236px;
    --menu-top-space: 20px;
    --menu-title-size: 19px;
    --menu-list-gap: 13px;
    --menu-list-padding-x: 16px;
    --menu-list-padding-bottom: 24px;
    --menu-item-height: 58px;
    --menu-item-padding-x: 18px;
    --menu-item-font-size: 15.5px;
    --menu-section-gap: 18px;
    width: var(--menu-width);
    min-width: var(--menu-width);
    max-width: var(--menu-width);
    height: 100%;
    position: relative;
    flex: 0 0 var(--menu-width);
    background: rgba(0, 30, 60, 0.97);
    padding: 0;
    box-shadow: 2px 0 16px 0 rgba(0, 200, 255, 0.08);
    border-right: 2px solid #00a0ff;
    z-index: 100;
    transition: left 0.3s, width 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.menu.menu--admin {
    --menu-width: 248px;
    --menu-list-gap: 11px;
    --menu-item-height: 54px;
    --menu-item-font-size: 14.5px;
    --menu-section-gap: 16px;
}
/*■■■■■■■■■■ メニュー文字 ■■■■■■■■■■*/
.menu h3 {
    font-size: var(--menu-title-size);
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.18em;
    color: #00f0ff;
    text-shadow: 0 0 8px #00f0ff;
    margin: var(--menu-top-space) 0 12px 0;
}
/*■■■■■■■■■■ メニューボタン ■■■■■■■■■■*/
.menu ul {
    width: 100%;
    list-style: none;
    text-align: center;
    padding: 14px var(--menu-list-padding-x) var(--menu-list-padding-bottom);
    margin: 0;
    flex: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--menu-list-gap);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.menu-item-shell {
    margin: 0;
    width: 100%;
}

.menu-item-shell--section-gap {
    margin-top: var(--menu-section-gap);
}

.menu-item-link {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    min-height: var(--menu-item-height);
    padding: 0 var(--menu-item-padding-x);
    margin: 0;
    border: 1px solid rgba(0, 196, 255, 0.68);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(7, 44, 76, 0.96) 0%, rgba(2, 27, 49, 0.96) 100%);
    box-shadow: 0 0 6px rgba(0, 180, 255, 0.14), inset 0 0 8px rgba(0, 120, 200, 0.12);
    color: #d6fdff;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Meiryo", 'Segoe UI', Arial, sans-serif;
    font-size: var(--menu-item-font-size);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: none;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
}

.menu-item-link:hover {
    background: rgba(0, 96, 168, 0.9);
    box-shadow: 0 0 16px #00f0ff, inset 0 0 12px #00c8ff;
    color: #fff;
    transform: translateY(-1px);
}

.menu-item-link.active {
    background: rgba(0, 108, 176, 0.5);
    box-shadow: 0 0 14px #00f0ff, inset 0 0 10px #00c8ff;
    border-color: #00f0ff;
    color: #fff;
    font-weight: bold;
}

.menu-item-link--alert {
    padding-right: 42px;
    border-color: #ff8f6b;
    box-shadow: 0 0 10px rgba(255, 143, 107, 0.65), inset 0 0 10px rgba(255, 143, 107, 0.18);
}

.menu-item-link--alert:hover,
.menu-item-link--alert.active {
    box-shadow: 0 0 16px rgba(255, 143, 107, 0.85), inset 0 0 12px rgba(255, 143, 107, 0.24);
}

.menu-alert-badge {
    position: absolute;
    top: 7px;
    right: 10px;
    min-width: 1.4em;
    height: 1.4em;
    padding: 0 0.32em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 196, 176, 0.95);
    background: linear-gradient(180deg, rgba(255, 124, 88, 0.95), rgba(215, 66, 78, 0.95));
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 10px rgba(255, 120, 96, 0.55);
    pointer-events: none;
}

@media (max-height: 860px) {
    .menu {
        --menu-top-space: 15px;
        --menu-title-size: 17px;
        --menu-list-gap: 11px;
        --menu-list-padding-x: 12px;
        --menu-list-padding-bottom: 16px;
        --menu-item-height: 50px;
        --menu-item-font-size: 14px;
        --menu-section-gap: 12px;
    }

    .menu.menu--admin {
        --menu-item-height: 46px;
        --menu-item-font-size: 13px;
        --menu-list-gap: 9px;
    }
}

@media (max-height: 760px) {
    .menu {
        --menu-top-space: 10px;
        --menu-title-size: 15px;
        --menu-list-gap: 7px;
        --menu-list-padding-x: 10px;
        --menu-list-padding-bottom: 12px;
        --menu-item-height: 42px;
        --menu-item-font-size: 12.5px;
        --menu-section-gap: 9px;
    }

    .menu.menu--admin {
        --menu-item-height: 40px;
        --menu-item-font-size: 11.5px;
        --menu-list-gap: 6px;
    }

    .menu .menu-alert-badge {
        top: 4px;
        min-width: 1.25em;
        height: 1.25em;
        font-size: 0.66em;
    }
}

.menu-toggle-btn {
    display: none;
}






/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 右側全部 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
.content-wrapper {
    box-sizing: border-box;
    width:auto;
    height:100%;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    background: rgba(0, 20, 40, 0.92);
    box-shadow: -2px 0 16px 0 rgba(0, 200, 255, 0.05);
    /* min-height: 100vh;  ← 広告が隠れる原因になるため一旦無効化 */
    transition: width 0.3s;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    overflow: hidden;
}
/*■■■■■■■■■■■■■■■■■■■■ 上部の権利表記とアカウントメニューおよび言語設定 ■■■■■■■■■■■■■■■■■■■■*/
.account-management {
    box-sizing: border-box;
    width:100%;
    height:5%;
    min-height: 40px;
    background: linear-gradient(90deg, #002040 60%, #003366 100%);
    padding: 0.5vh 5vw;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    color: #00f0ff;
    border-bottom: 1.5px solid #00a0ff;
    gap: 10px;
}
/*■■■■■ 権利表記 ■■■■■*/
.site-notice {
    font-size: clamp(10px, 1vmax, 20px);
    color: #b2ebf2;
    margin-left: 2px;
    margin-right: 16px;
    white-space: normal;
    max-width: 44vw;
    min-width: 120px;
    text-align: left;
    line-height: 1.18;
    opacity: 0.85;
    flex-shrink: 1;
    flex-grow: 0;
    overflow: visible;
    text-overflow: unset;
    pointer-events: none;
    user-select: text;
    display: flex;
    align-items: center;
}
/*■■■■■ アカウントメニューと言語設定 ■■■■■*/
.account-info-group {
    font-size: clamp(10px, 1.2vmax, 20px);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    width:35%;
    letter-spacing: 0.3vw;
    justify-content: flex-end;
}
.account-management a {
    color: #00f0ff;
    margin-left: 12px;
}
.account-management a:hover {
    color: #fff;
    text-shadow: 0 0 8px #00f0ff;
}
/*■■■■■ 言語設定 ■■■■■*/
.lang-switcher-form {
    display: inline-block;
    margin-left: 24px;
    vertical-align: middle;
}
.lang-switcher-noscript-btn {
    margin-left: 4px;
}
.lang-switcher-select {
    background: rgba(0,30,60,0.85);
    color: #00f0ff;
    border: 1.5px solid #00a0ff;
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 0.92em;
    line-height: 1.2;
    min-height: 30px;
    margin-right: 4px;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Meiryo", 'Segoe UI', Arial, sans-serif;
    font-weight: bold;
    transition: border 0.2s, box-shadow 0.2s, color 0.2s, background 0.2s;
}
.lang-switcher-select:focus, .lang-switcher-select:hover {
    border: 2px solid #00f0ff;
    box-shadow: 0 0 8px #00f0ff99;
    background: rgba(0, 80, 160, 0.9);
    color: #fff;
}




/*■■■■■■■■■■■■■■■■■■■■ 下部メインコンテンツ表示領域 ■■■■■■■■■■■■■■■■■■■■*/
.content {
    box-sizing: border-box;
    width:100%;
    height: 95%;
    /*height: calc(95% - 60px);*/
    padding: 1.5vmin 1.5vmin 0 1.5vmin;
    min-height: 0;
}

/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ HOME ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
.home-welcome{
    color:"white";
}

.home-rule-list {
    list-style: none;
    margin: 0;
    padding: 0;
}





/* 画像アップロードフォーム中央寄せ */
.image-upload-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
    width: 100%;
    max-width: 860px;
    min-width: 0;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.image-library {
    flex: 1 1 auto;
    min-height: 0;
    width: min(100%, 1120px);
    margin: 16px auto 0;
    padding: 6px 12px 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: minmax(286px, auto);
    align-items: stretch;
    gap: 16px;
    overflow-y: visible;
    overflow-x: hidden;
    box-sizing: border-box;
}

.image-library-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    min-height: 286px;
    border: 1px solid rgba(110, 182, 255, 0.24);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(5, 13, 34, 0.96) 0%, rgba(8, 18, 42, 0.94) 100%);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(138, 210, 255, 0.05);
    overflow: hidden;
    box-sizing: border-box;
}

.image-library-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(92, 149, 255, 0.08) 0%, rgba(92, 149, 255, 0) 38%), linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 24%);
    pointer-events: none;
}

.image-library-preview {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 0.78;
    min-height: 164px;
    padding: 10px;
    border: 1px solid rgba(110, 182, 255, 0.24);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(3, 9, 25, 0.95) 0%, rgba(8, 17, 39, 0.95) 100%);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-sizing: border-box;
}

.image-library-preview:hover,
.image-library-preview:focus-visible {
    border-color: rgba(120, 220, 255, 0.65);
    box-shadow: 0 0 0 1px rgba(120, 220, 255, 0.2), 0 10px 20px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
    outline: none;
}

.image-library-image.uploaded-image {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin-right: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}

.image-library-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
}

.image-library-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.image-library-name {
    color: rgba(190, 214, 234, 0.9);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.image-library-subline {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    flex-wrap: wrap;
}

.image-library-time {
    color: rgba(190, 214, 234, 0.82);
    font-size: 0.78rem;
    line-height: 1.4;
    word-break: break-word;
}

.image-library-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    height: auto;
    justify-content: flex-start;
}

.image-library-action.small-btn,
.image-library-action.ha-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    min-height: 28px;
    padding: 4px 10px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    margin: 0;
    box-sizing: border-box;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.uploaded-image {
    max-width: 78px;
    max-height: 78px;
    object-fit:scale-down;
    margin-right: 10px;
    vertical-align: middle;
    border: 1.5px solid #00a0ff;
    border-radius: 4px;
    background: #001e3c;
    box-shadow: 0 0 6px #00c8ff33;
}
.uploads-table {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-collapse: collapse;
    margin-top: 12px;
    background: rgba(0, 30, 60, 0.85);
    color: #e0f7fa;
    box-shadow: 0 0 12px #00c8ff22;
}
.uploads-table thead {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.uploads-table tbody {
    display: block;
    max-height: calc(100svh - 180px);
    overflow-y: auto;
    width: 100%;
}
.uploads-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.uploads-table th, .uploads-table td {
    border: 0px solid #00a0ff;
    padding: 6px;
    text-align: center;
    height: 78px;
    max-height: 78px;
    overflow: hidden;
    background: rgba(0, 30, 60, 0.7);
}
.uploads-table th {
    background: rgba(0, 80, 160, 0.8);
    color: #00f0ff;
    font-weight: bold;
    text-shadow: 0 0 6px #00f0ff99;
    font-size: 0.8vw;
    height: 1.7vh;
}
.uploads-table td button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 72px;
    color: #00f0ff;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Meiryo", 'Segoe UI', Arial, sans-serif;
    font-size: 0.95vw;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 30, 60, 0.8);
    border: 1.5px solid #00a0ff;
    border-radius: 2px;
    box-shadow: 0 0 3px rgba(0, 200, 255, 0.5), inset 0 0 5px rgba(0, 150, 255, 0.3);
    transition: all 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 0;
    padding: 0 6px;
    cursor: pointer;
}
.uploads-table td button:hover {
    background: rgba(0, 80, 160, 0.9);
    box-shadow: 0 0 10px #00f0ff, inset 0 0 10px #00c8ff;
    color: #fff;
    transform: scale(1.04);
}
/* --- Forms --- */
.new-character-form, .edit-character-form, .editor-form-shell {
    border: 2.5px solid #00f0ff;
    border-radius: 14px;
    box-shadow: 0 0 24px 4px #00c8ff66, 0 0 0 2px #001e3c;
    background: linear-gradient(135deg, #001e3c 60%, #003366 100%);
    color: #e0f7fa;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 8px;
    margin: 12px auto;
    max-width: var(--ha-editor-form-max-width);
    min-width: 640px;
    width: 100%;
    gap: 12px;
    transition: box-shadow 0.2s, border 0.2s;
}
.auth-form-shell {
    width: min(100%, 430px);
}

.auth-form {
    width: 100%;
    max-width: 430px;
    min-width: 0;
    margin: 0;
    padding: 18px 14px 14px 14px;
    gap: 14px;
}

.auth-form input,
.auth-form textarea {
    margin: 2px 0;
}

.auth-form button {
    width: 100%;
}
.image-upload-form,
#image-upload-form {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: #e0f7fa;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
    margin: 12px auto;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    gap: 12px;
    box-sizing: border-box;
}
.image-upload-file {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border: 2.5px solid #00a0ff;
    border-radius: 10px;
    padding: 9px 14px;
    background: linear-gradient(135deg, rgba(0, 30, 60, 0.9) 60%, rgba(0, 51, 102, 0.9) 100%);
    box-shadow: 0 0 14px 1px #00c8ff44;
}

.cropper-upload-note {
    color: #888;
    font-size: 0.95em;
}

.cropper-upload-note-inline {
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0;
    font-size: 0.82em;
}

.new-character-form form, .edit-character-form form, .editor-form-shell form {
    display: flex;
    flex-direction: row;
    width: 100%;
}
.form-fields {
    flex: 0 0 85%;
    max-width: 85%;
    display: flex;
    flex-direction: column;
    /*gap: 0.5em;*/
}
.form-submit-vertical {
    flex: 0 0 15%;
    max-width: 15%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    min-width: 90px;
}
.form-submit-vertical button[type="submit"] {
    width: 100%;
    height: 100%;
    min-height: 120px;
    font-size: 1.3em;
    border-radius: 0 8px 8px 0;
    margin: 0;
    box-shadow: 0 0 16px #00c8ff99;
}
.new-character-form h1, .edit-character-form h1, .editor-form-shell h1, .edit-character-form h2, .new-character-form h2, .editor-form-shell h2 {
    color: #00f0ff;
    text-shadow: 0 0 8px #00f0ff99;
    text-align: center;
    margin-bottom: 18px;
}
.new-character-form label, .edit-character-form label, .editor-form-shell label {
    color: #00f0ff;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    text-shadow: 0 0 4px #00f0ff99;
}
.image-upload-form label,
#image-upload-form label {
    color: #00f0ff;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    text-shadow: 0 0 4px #00f0ff99;
}
.new-character-form input, .edit-character-form input, .editor-form-shell input,
.new-character-form textarea, .edit-character-form textarea, .editor-form-shell textarea {
    width: 100%;
    padding: 6px;
    margin: 2px 20px 2px 0;
    border: 2px solid #00a0ff;
    border-radius: 4px;
    background: rgba(0, 30, 60, 0.85);
    color: #e0f7fa;
    font-size: 1.08em;
    box-sizing: border-box;
    transition: border 0.2s, box-shadow 0.2s;
    outline: none;
    box-shadow: 0 0 8px #00c8ff33;
}
.image-upload-form input[type="file"],
#image-upload-form input[type="file"],
.image-upload-input {
    flex: 1 1 320px;
    width: 100%;
    min-height: 48px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #e0f7fa;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Meiryo", 'Segoe UI', Arial, sans-serif;
    font-size: 1.05em;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
    outline: none;
    box-shadow: none;
    display: block;
    line-height: 1.35;
    overflow: visible;
}
.image-upload-file input[type="file"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.image-upload-form input[type="file"]::file-selector-button,
#image-upload-form input[type="file"]::file-selector-button,
.image-upload-input::file-selector-button {
    margin-right: 12px;
    min-height: 44px;
    padding: 8px 16px;
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    color: #00f0ff;
    background: linear-gradient(90deg, #002040 60%, #003366 100%);
    border: 2.5px solid #00a0ff;
    border-radius: 4px;
    box-shadow: 0 0 12px #00c8ff99, 0 0 4px #00a0ff55;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Meiryo", 'Segoe UI', Arial, sans-serif;
    font-size: 0.98em;
    font-weight: bold;
    line-height: 1.2;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.2s;
}
.image-upload-form input[type="file"]::-webkit-file-upload-button,
#image-upload-form input[type="file"]::-webkit-file-upload-button,
.image-upload-input::-webkit-file-upload-button {
    margin-right: 12px;
    min-height: 44px;
    padding: 8px 16px;
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    color: #00f0ff;
    background: linear-gradient(90deg, #002040 60%, #003366 100%);
    border: 2.5px solid #00a0ff;
    border-radius: 4px;
    box-shadow: 0 0 12px #00c8ff99, 0 0 4px #00a0ff55;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Meiryo", 'Segoe UI', Arial, sans-serif;
    font-size: 0.98em;
    font-weight: bold;
    line-height: 1.2;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.2s;
}
.image-upload-form input[type="file"]::file-selector-button:hover,
#image-upload-form input[type="file"]::file-selector-button:hover,
.image-upload-input::file-selector-button:hover,
.image-upload-form input[type="file"]::-webkit-file-upload-button:hover,
#image-upload-form input[type="file"]::-webkit-file-upload-button:hover,
.image-upload-input::-webkit-file-upload-button:hover {
    background: rgba(0, 80, 160, 0.9);
    box-shadow: 0 0 14px #00f0ff, inset 0 0 10px #00c8ff;
    color: #fff;
    border-color: #00f0ff;
}
.new-character-form textarea, .edit-character-form textarea, .editor-form-shell textarea {
    min-height: 10vh;
    resize: vertical;
}

textarea[name="description"] {
    height: 12vh;
}
textarea[name="description_long"] {
    height: 24vh;
}

.new-character-form input:focus, .edit-character-form input:focus, .editor-form-shell input:focus,
.new-character-form textarea:focus, .edit-character-form textarea:focus, .editor-form-shell textarea:focus {
    border: 2px solid #00f0ff;
    box-shadow: 0 0 12px #00f0ff99;
    outline: none;
}
.new-character-form button, .edit-character-form button, .editor-form-shell button, .back-to-top,
.image-upload-form button,
#image-upload-form button,
.image-upload-btn,
.cropper-reset-btn,
.cropper-submit {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 44px;
    color: #00f0ff;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Meiryo", 'Segoe UI', Arial, sans-serif;
    font-size: 1.05em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #002040 60%, #003366 100%);
    border: 2.5px solid #00a0ff;
    border-radius: 4px;
    box-shadow: 0 0 12px #00c8ff99, 0 0 4px #00a0ff55;
    transition: all 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 12px 0 0 0;
    padding: 0 18px;
    cursor: pointer;
    font-weight: bold;
}
.new-character-form button:hover, .edit-character-form button:hover, .editor-form-shell button:hover, .back-to-top:hover,
.image-upload-form button:hover,
#image-upload-form button:hover,
.image-upload-btn:hover,
.cropper-reset-btn:hover,
.cropper-submit:hover {
    background: rgba(0, 80, 160, 0.9);
    box-shadow: 0 0 16px #00f0ff, inset 0 0 12px #00c8ff;
    color: #fff;
    border-color: #00f0ff;
    transform: scale(1.00);
}
.cropper-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 2px;
}
.cropper-reset-btn {
    margin-left: 0 !important;
}
.cropper-actions .image-upload-btn {
    margin: 0;
    height: 40px;
}
/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,0.7);
}

.modal.is-open {
    display: block;
}

.modal-content {
    position: fixed;
    background: #001e3c;
    padding: 20px;
    border: 2px solid #00a0ff;
    border-radius: 12px;
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0 24px #00c8ff55;
    outline: none;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.close {
    color: #00f0ff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.2s;
}
.close:hover,
.close:focus {
    color: #fff;
    text-shadow: 0 0 8px #00f0ff;
    cursor: pointer;
}

.ha-confirm-modal-content {
    width: min(380px, calc(100vw - 32px));
}

.ha-confirm-close {
    appearance: none;
    border: 0;
    background: transparent;
    line-height: 1;
    padding: 0;
}

.ha-confirm-title {
    margin: 0 28px 12px;
    color: #e0f7fa;
    font-size: 1.25rem;
}

.ha-confirm-message {
    color: #b2ebf2;
    margin: 0 0 18px;
    line-height: 1.5;
}

.ha-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ha-image-picker-modal {
    z-index: 1400;
}

.ha-image-picker-panel {
    width: min(1060px, calc(100vw - 44px));
    max-height: min(84vh, 720px);
    text-align: left;
}

.ha-image-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.ha-image-picker-title {
    margin: 0;
    color: #e0f7fa;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    letter-spacing: 0.04em;
}

.ha-image-picker-tools {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ha-image-picker-search {
    min-width: 0;
    height: 38px;
    border: 1px solid rgba(0, 160, 255, 0.75);
    border-radius: 8px;
    background: rgba(0, 12, 28, 0.88);
    color: #e0f7fa;
    padding: 0 12px;
    outline: none;
}

.ha-image-picker-search:focus {
    border-color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.32);
}

.ha-image-picker-count {
    color: rgba(190, 214, 234, 0.9);
    font-size: 0.85rem;
    white-space: nowrap;
}

.ha-image-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
    max-height: min(58vh, 520px);
    overflow: auto;
    padding: 10px;
    border: 1px solid rgba(0, 160, 255, 0.45);
    border-radius: 10px;
    background: rgba(0, 8, 20, 0.55);
}

.ha-image-picker-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(0, 160, 255, 0.48);
    border-radius: 9px;
    background: rgba(2, 13, 28, 0.92);
    color: #e0f7fa;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.ha-image-picker-card:hover,
.ha-image-picker-card:focus-visible,
.ha-image-picker-card.is-selected {
    border-color: #00f0ff;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.28);
    transform: translateY(-1px);
    outline: none;
}

.ha-image-picker-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: #05080d;
}

.ha-image-picker-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ha-image-picker-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ha-image-picker-filename {
    overflow: hidden;
    color: #f3fbff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ha-image-picker-size {
    color: rgba(190, 214, 234, 0.82);
    font-size: 0.76rem;
    line-height: 1.3;
}

.ha-image-picker-empty {
    grid-column: 1 / -1;
    color: rgba(190, 214, 234, 0.9);
    padding: 18px;
    text-align: center;
}

.ha-image-picker-screen.is-hidden {
    display: none;
}

.ha-image-cropper-screen {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ha-image-cropper-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.ha-image-cropper-usage {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid rgba(0, 160, 255, 0.38);
    border-radius: 999px;
    background: rgba(4, 12, 22, 0.92);
    color: #8fdfff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.ha-image-cropper-filename {
    min-width: 0;
    color: #f3fbff;
    font-size: 0.88rem;
    font-weight: 700;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ha-image-cropper-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: 1px solid rgba(0, 160, 255, 0.28);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(6, 12, 20, 0.98) 0%, rgba(5, 18, 32, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 34px rgba(0, 0, 0, 0.28);
}

.ha-image-cropper-canvas {
    display: block;
    width: min(100%, 520px);
    max-width: 100%;
    border-radius: 16px;
    background: #090c11;
    border: 1px solid rgba(108, 214, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 16px 28px rgba(0, 0, 0, 0.34);
    cursor: grab;
}

.ha-image-cropper-canvas:active {
    cursor: grabbing;
}

.ha-image-cropper-controls {
    display: flex;
    justify-content: center;
}

.ha-image-cropper-range {
    width: min(100%, 420px);
    accent-color: #00f0ff;
}

.ha-image-cropper-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.ha-image-cropper-lock {
    margin-right: auto;
}

@media (max-width: 720px) {
    .ha-image-picker-tools {
        grid-template-columns: 1fr;
    }

    .ha-image-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .ha-image-picker-field {
        flex-direction: column;
    }

    .ha-image-picker-trigger {
        width: 100%;
    }

    .ha-image-cropper-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .ha-image-cropper-filename {
        text-align: left;
    }

    .ha-image-cropper-actions {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .ha-image-cropper-actions .ha-action-btn {
        flex: 1 1 100%;
    }
}
/* --- Action Buttons --- */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-start;
}
/* --- Toast --- */
.toast {
    visibility: hidden;
    min-width: 250px;
    max-width: 50vw;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    border: 2px solid #00a0ff;
    padding: 16px;
    position: fixed;
    z-index: 1001;
    left: 50%;
    bottom: 30px;
    font-size: 16px;
    box-shadow: 0 0 12px #00c8ff99;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    pointer-events: none;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation-fill-mode: forwards;
}

/* ホームの「ようこそ」部分を中央寄せ */
.home-welcome {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    text-align: center;
    overflow-y: auto;
    height: 90%;
}

.content[data-page]:not([data-page="characters"]):not([data-page="my_worlds"]):not([data-page="management"]):not([data-page="uploads_list"]):not([data-page="activate_users"]) {
    overflow-y: auto;
    overflow-x: hidden;
}

.content[data-page="activate_users"] {
    padding-bottom: 1.5vmin;
}

.content[data-page="image_manage"] {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: stretch;
    padding-top: 10px;
    padding-bottom: 24px;
}

.content[data-page="image_manage"] .image-upload-panel {
    flex: 0 0 auto;
    width: min(100%, 860px);
    max-width: 860px;
    min-height: 110px;
    margin: 0 auto;
    padding: 8px 20px 14px;
}

.content[data-page="image_manage"] #image-upload-form {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.content[data-page="image_manage"] .image-upload-file {
    min-height: 72px;
}

.content[data-page="home"] .home-welcome {
    min-height: 100%;
    height: auto;
    overflow: visible;
}

.content[data-page="characters"] {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content[data-page="characters"] .character-header {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.content[data-page="characters"] .characters {
    flex: 1 1 auto;
    min-height: 0;
    height: 95%;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0;
}

.content[data-page="characters"] .characters.card-size-def {
    padding-top: 16px;
    overflow-y: hidden;
}

.content[data-page="characters"] .characters.card-size-def .characte-def-row-thumbnails {
    margin-bottom: 0;
}

.content[data-page="characters"] .characters.card-size-s .character-card,
.content[data-page="characters"] .characters.card-size-m .character-card,
.content[data-page="characters"] .characters.card-size-detailed .character-card {
    margin-top: 0;
}

.content[data-page="characters"] .card-size-s .character-card,
.content[data-page="characters"] .card-size-m .character-card,
.content[data-page="characters"] .card-size-detailed .character-card,
.content[data-page="characters"] .card-size-def .character-card.characte-def-detail-card {
    border: 2px solid #00a0ff;
    box-shadow: 0 0 18px 2px #00c8ff33, 0 0 0 2px #001e3c;
}

.content[data-page="characters"] .card-size-s .character-card:hover,
.content[data-page="characters"] .card-size-m .character-card:hover,
.content[data-page="characters"] .card-size-detailed .character-card:hover,
.content[data-page="characters"] .card-size-def .character-card.characte-def-detail-card:hover {
    border: 2.5px solid #00f0ff;
    box-shadow: 0 0 24px 4px #00f0ff99, 0 0 0 2px #001e3c;
}

.content[data-page="characters"] .detailed-cards-grid {
    margin-top: 0;
    margin-bottom: 0;
}

.content[data-page="characters"] .card-size-detailed .character-card {
    margin: 0 auto 0.5vw auto;
    height: auto;
}

.content[data-page="my_worlds"],
.content[data-page="management"],
.content[data-page="fanart_manage"],
.content[data-page="uploads_list"],
.content[data-page="activate_users"] {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content--public-users {
    display: flex;
    align-items: center;
    overflow-x: hidden;
    overflow-y: hidden;
}

.content[data-page="my_worlds"] .world-page-header {
    flex: 0 0 auto;
}

.content[data-page="my_worlds"] .world-manage-grid,
.content[data-page="management"] .my-characters-manage,
.content[data-page="fanart_manage"] .fanart-manage-page,
.content[data-page="uploads_list"] .character-form-center,
.content[data-page="activate_users"] .admin-tabs-container {
    flex: 1 1 auto;
    min-height: 0;
}

.content[data-page="my_worlds"] .world-manage-grid {
    margin-bottom: 0;
}
@keyframes fadein {
    from { bottom: 0; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}
@keyframes fadeout {
    from { bottom: 30px; opacity: 1; }
    to { bottom: 0; opacity: 0; }
}


/* --- index.php整理用: ヘッダー・ボタン群のflexレイアウト --- */

/* フォームタイトル中央寄せ用 */
.form-title-center {
    text-align: center;
    width: 100%;
    margin-bottom: 0.5em;
}















/* --- Shared Button Tokens --- */
:root {
    --ha-editor-shell-gutter: clamp(12px, 1.35vw, 22px);
    --ha-editor-form-max-width: 80em;
    --ha-management-shell-width: min(1400px, calc(100% - (var(--ha-editor-shell-gutter) * 2)));
    --ha-section-tab-radius: 14px;
    --ha-section-tab-border: rgba(0, 170, 255, 0.36);
    --ha-section-tab-border-hover: rgba(112, 235, 255, 0.6);
    --ha-section-tab-border-active: rgba(118, 236, 255, 0.8);
    --ha-section-tab-bg:
        linear-gradient(180deg, rgba(7, 18, 44, 0.96) 0%, rgba(10, 28, 58, 0.94) 100%);
    --ha-section-tab-bg-active:
        linear-gradient(180deg, rgba(18, 56, 96, 0.98) 0%, rgba(10, 84, 128, 0.92) 100%);
    --ha-section-tab-text: rgba(211, 240, 255, 0.82);
    --ha-section-tab-text-strong: #f7fdff;
    --ha-section-tab-shadow:
        inset 0 0 0 1px rgba(108, 194, 255, 0.05),
        0 10px 24px rgba(0, 0, 0, 0.18);
    --ha-section-tab-shadow-hover:
        inset 0 0 0 1px rgba(112, 235, 255, 0.12),
        0 12px 26px rgba(0, 0, 0, 0.24),
        0 0 18px rgba(0, 220, 255, 0.12);
    --ha-section-tab-shadow-active:
        inset 0 0 0 1px rgba(168, 241, 255, 0.15),
        0 14px 28px rgba(0, 0, 0, 0.22),
        0 0 22px rgba(0, 220, 255, 0.16);
    --ha-management-action-radius: 12px;
    --ha-management-action-height: 36px;
    --ha-management-action-border: rgba(84, 192, 255, 0.6);
    --ha-management-action-border-hover: rgba(112, 235, 255, 0.82);
    --ha-management-action-bg:
        linear-gradient(180deg, rgba(15, 56, 90, 0.96) 0%, rgba(8, 34, 58, 0.98) 100%);
    --ha-management-action-bg-hover:
        linear-gradient(180deg, rgba(21, 74, 118, 0.98) 0%, rgba(11, 44, 74, 0.98) 100%);
    --ha-management-action-text: #d9f2ff;
    --ha-management-action-text-strong: #f3fbff;
    --ha-management-action-shadow:
        0 8px 18px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --ha-management-action-shadow-hover:
        0 0 18px rgba(0, 176, 255, 0.18),
        0 8px 18px rgba(0, 0, 0, 0.16);
    --ha-management-danger-border: rgba(194, 108, 148, 0.68);
    --ha-management-danger-border-hover: rgba(231, 152, 189, 0.86);
    --ha-management-danger-bg:
        linear-gradient(180deg, rgba(76, 28, 48, 0.96) 0%, rgba(46, 18, 31, 0.98) 100%);
    --ha-management-danger-bg-hover:
        linear-gradient(180deg, rgba(102, 40, 65, 0.98) 0%, rgba(56, 21, 38, 0.98) 100%);
    --ha-management-danger-text: #ffd9e5;
    --ha-management-danger-shadow:
        0 0 18px rgba(226, 126, 170, 0.16),
        0 8px 18px rgba(0, 0, 0, 0.16);
}

/* --- Legacy Compact Button Skin For Untouched Pages --- */
.small-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em !important;
    background: linear-gradient(90deg, #002040 60%, #003366 100%);
    color: #00f0ff !important;
    border: 2px solid #00a0ff;
    border-radius: 4px;
    box-shadow: 0 0 8px #00c8ff55, 0 0 2px #00a0ff33;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
    transition: all 0.2s;
}
.small-btn:hover, .small-btn:focus {
    background: rgba(0, 80, 160, 0.9);
    color: #fff !important;
    border-color: #00f0ff;
    box-shadow: 0 0 12px #00f0ff, 0 0 4px #00a0ff55;
}

.editor-mode-selector {
    --editor-mode-selector-card-width: 300px;
    --editor-mode-selector-grid-width: 980px;
    --editor-mode-selector-gap: 40px;
    --editor-mode-selector-mobile-width: min(300px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(100%, 1040px);
    margin: clamp(18px, 5vh, 56px) auto 24px;
    text-align: center;
}

.editor-mode-selector-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.editor-mode-selector-title {
    color: #00f0ff;
    font-weight: bold;
}

.editor-mode-selector-target {
    color: #b7d9ff;
    font-size: 0.92em;
}

.editor-mode-selector-links {
    display: grid;
    grid-template-columns: repeat(3, var(--editor-mode-selector-card-width));
    justify-content: center;
    align-items: stretch;
    gap: var(--editor-mode-selector-gap);
    width: min(100%, var(--editor-mode-selector-grid-width));
}

.editor-mode-selector-link {
    text-decoration: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: var(--editor-mode-selector-card-width);
    aspect-ratio: 351 / 498;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0, 26, 48, 0.96) 0%, rgba(0, 42, 74, 0.92) 100%);
    box-shadow: 0 0 16px #00c8ff33, inset 0 0 0 1px rgba(0, 240, 255, 0.08);
}

.editor-mode-selector-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, rgba(0, 18, 36, 0.1) 0%, rgba(0, 18, 36, 0.24) 60%, rgba(0, 14, 28, 0.78) 100%);
    pointer-events: none;
}

.editor-mode-selector-link-media {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    z-index: 1;
}

.editor-mode-selector-link-image,
.editor-mode-selector-link-placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.editor-mode-selector-link-image {
    object-fit: cover;
    image-rendering: auto;
}

.editor-mode-selector-link-placeholder {
    background:
        linear-gradient(135deg, rgba(220, 246, 255, 0.16) 0%, rgba(220, 246, 255, 0.02) 28%, rgba(0, 20, 42, 0.12) 100%),
        linear-gradient(180deg, rgba(0, 150, 210, 0.18) 0%, rgba(0, 38, 74, 0.12) 100%);
}

.editor-mode-selector-link-label {
    position: relative;
    z-index: 3;
    display: block;
    width: 100%;
    padding: 18px 14px 20px;
    font-size: 1rem;
    font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    background: linear-gradient(180deg, rgba(0, 22, 42, 0) 0%, rgba(0, 22, 42, 0.28) 16%, rgba(0, 14, 28, 0.76) 100%);
}

.editor-mode-selector--add .editor-mode-selector-link::before {
    content: "+";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -56%);
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(2.4rem, 6vw, 3.1rem);
    font-weight: 100;
    letter-spacing: -0.05em;
    line-height: 1;
    color: rgba(220, 246, 255, 0.3);
    text-shadow: 0 0 20px rgba(160, 238, 255, 0.18);
    pointer-events: none;
}

.editor-mode-selector--edit .editor-mode-selector-link::before {
    content: "EDIT";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -56%);
    font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
    font-size: clamp(1.35rem, 3.6vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0.3em;
    line-height: 1;
    color: rgba(220, 246, 255, 0.28);
    text-shadow: 0 0 20px rgba(160, 238, 255, 0.16);
    pointer-events: none;
}

.editor-mode-selector--add .editor-mode-selector-link-label,
.editor-mode-selector--edit .editor-mode-selector-link-label {
    opacity: 0.75;
    transition: opacity 0.18s ease;
}

.editor-mode-selector--add .editor-mode-selector-link:hover .editor-mode-selector-link-label,
.editor-mode-selector--add .editor-mode-selector-link:focus-visible .editor-mode-selector-link-label,
.editor-mode-selector--add .editor-mode-selector-link.is-active .editor-mode-selector-link-label,
.editor-mode-selector--add .editor-mode-selector-link[aria-current="page"] .editor-mode-selector-link-label,
.editor-mode-selector--edit .editor-mode-selector-link:hover .editor-mode-selector-link-label,
.editor-mode-selector--edit .editor-mode-selector-link:focus-visible .editor-mode-selector-link-label,
.editor-mode-selector--edit .editor-mode-selector-link.is-active .editor-mode-selector-link-label,
.editor-mode-selector--edit .editor-mode-selector-link[aria-current="page"] .editor-mode-selector-link-label {
    opacity: 1;
}

.editor-mode-selector-link--character.has-placeholder {
    background: linear-gradient(180deg, rgba(0, 40, 74, 0.96) 0%, rgba(0, 22, 42, 0.98) 100%);
}

.editor-mode-selector-link--world.has-placeholder {
    background: linear-gradient(180deg, rgba(8, 46, 80, 0.96) 0%, rgba(0, 20, 36, 0.98) 100%);
}

.editor-mode-selector-link--illustration.has-placeholder {
    background: linear-gradient(180deg, rgba(0, 58, 72, 0.96) 0%, rgba(0, 22, 34, 0.98) 100%);
}

.editor-mode-selector-link.is-active,
.editor-mode-selector-link[aria-current="page"] {
    background: rgba(0, 80, 160, 0.9);
    color: #fff !important;
    border-color: #00f0ff;
    box-shadow: 0 0 12px #00f0ff, 0 0 4px #00a0ff55;
}

.editor-mode-selector-link.is-active::after,
.editor-mode-selector-link[aria-current="page"]::after {
    background: linear-gradient(180deg, rgba(0, 24, 48, 0.08) 0%, rgba(0, 24, 48, 0.24) 56%, rgba(0, 12, 26, 0.64) 100%);
}

.editor-quick-switch-panel {
    box-sizing: border-box;
    width: min(1400px, 100%);
    max-width: 100%;
    margin: 0 auto 18px;
    padding: 8px var(--ha-editor-shell-gutter) 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.content[data-page="uploads_list"] .editor-quick-switch-panel {
    position: static;
    top: auto;
    z-index: auto;
    padding-top: 0;
    background: transparent;
}

.editor-quick-switch-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.editor-quick-switch-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0 clamp(112px, 20vw, 320px);
    text-align: center;
}

.editor-quick-switch-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    font-size: clamp(0.8rem, 0.95vw, 0.9rem);
    font-weight: 700;
    letter-spacing: 0.22em;
    color: #d7ecff;
    text-shadow: 0 0 12px rgba(120, 198, 255, 0.14);
}

.editor-quick-switch-wrap {
    position: absolute;
    top: 50%;
    right: 0;
    display: flex;
    justify-content: flex-end;
    width: auto;
    max-width: min(68%, 760px);
    margin-top: 0;
    transform: translateY(-50%);
}

.editor-quick-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: auto;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.admin-manage-tab,
.editor-quick-switch-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 10px 14px;
    border: 1px solid var(--ha-section-tab-border);
    border-radius: var(--ha-section-tab-radius);
    background: var(--ha-section-tab-bg);
    color: var(--ha-section-tab-text);
    font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
    font-size: clamp(13px, 0.9vw, 15px);
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    opacity: 1;
    visibility: visible;
    -webkit-text-fill-color: currentColor;
    text-shadow: 0 0 14px rgba(90, 220, 255, 0.16);
    box-shadow: var(--ha-section-tab-shadow);
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.editor-quick-switch-link {
    min-width: clamp(74px, 6.2vw, 102px);
    min-height: 24px;
    padding: 3px 8px;
    font-size: clamp(9.5px, 0.64vw, 11px);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    border-radius: 10px;
    margin-bottom: 0;
    text-shadow: 0 0 8px rgba(90, 220, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(108, 194, 255, 0.04),
        0 4px 10px rgba(0, 0, 0, 0.14);
}

.admin-manage-tab:hover,
.admin-manage-tab:focus-visible,
.editor-quick-switch-link:hover,
.editor-quick-switch-link:focus-visible {
    color: var(--ha-section-tab-text-strong);
    border-color: var(--ha-section-tab-border-hover);
    box-shadow:
        inset 0 0 0 1px rgba(112, 235, 255, 0.1),
        0 6px 12px rgba(0, 0, 0, 0.18),
        0 0 10px rgba(0, 220, 255, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.admin-manage-tab.is-active,
.editor-quick-switch-link.is-active,
.admin-manage-tab[aria-current="page"],
.editor-quick-switch-link[aria-current="page"] {
    color: #ffffff;
    border-color: var(--ha-section-tab-border-active);
    background: var(--ha-section-tab-bg-active);
    box-shadow:
        inset 0 0 0 1px rgba(168, 241, 255, 0.12),
        0 6px 14px rgba(0, 0, 0, 0.18),
        0 0 12px rgba(0, 220, 255, 0.1);
}

.editor-quick-switch-note {
    min-height: 1.2em;
    margin-top: 6px;
    color: #87aecd;
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.2;
}

.editor-quick-switch-note.is-empty {
    visibility: hidden;
}

@media (max-width: 1380px), (orientation: portrait) and (max-width: 1500px) {
    .editor-management-item--character {
        grid-template-columns: 28px 62px minmax(0, 1fr);
    }

    .editor-management-item--world {
        grid-template-columns: 28px 52px minmax(0, 1fr);
    }

    .editor-management-item--fanart {
        grid-template-columns: 28px 78px minmax(0, 1fr);
    }

    .editor-management-visibility,
    .editor-management-actions {
        grid-column: 2 / -1;
        justify-self: stretch;
        width: 100%;
        max-width: none;
        flex-wrap: wrap;
    }

    .editor-management-title-row {
        flex-wrap: wrap;
    }

    .editor-management-title-text,
    .editor-management-meta,
    .editor-management-filename,
    .editor-management-summary {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
    }

    .editor-management-meta {
        font-size: 0.98rem;
    }

    .editor-management-summary {
        font-size: 0.98rem;
        line-height: 1.65;
    }
}

@media (max-width: 720px) {
    .editor-quick-switch-panel {
        margin-bottom: 14px;
        padding: 10px 12px 0;
    }

    .editor-quick-switch-head {
        min-height: 0;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .editor-quick-switch-copy {
        min-height: 0;
        padding: 0;
    }

    .editor-quick-switch-wrap {
        position: static;
        width: 100%;
        max-width: none;
        margin-top: 0;
        justify-content: center;
        transform: none;
    }

    .editor-quick-switch-note {
        text-align: center;
    }

    .editor-quick-switch {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        gap: 10px;
        padding-bottom: 0;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .editor-quick-switch::-webkit-scrollbar {
        display: none;
    }

    .editor-quick-switch-link {
        flex: 0 0 auto;
        min-width: 96px;
        min-height: 28px;
    }

    .editor-mode-selector-links {
        grid-template-columns: 1fr;
        width: var(--editor-mode-selector-mobile-width);
    }

    .editor-mode-selector-link {
        width: var(--editor-mode-selector-mobile-width);
    }

    .editor-management-card {
        padding: 16px 14px 16px;
        border-radius: 16px;
    }

    .editor-management-card-head,
    .editor-management-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .editor-management-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .editor-management-visibility,
    .editor-management-actions {
        grid-column: auto;
    }

    .editor-management-drag-handle {
        justify-content: flex-start;
    }

    .editor-management-thumb-wrap {
        width: 100%;
        max-width: 220px;
        height: 140px;
    }

    .editor-management-item--character .editor-management-thumb-wrap--character {
        width: 72px;
        height: 72px;
        max-width: none;
    }
}

@media (max-width: 760px) {
    .image-library {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(300px, auto);
        padding-left: 10px;
        padding-right: 10px;
    }

    .image-library-card {
        min-height: 300px;
    }

    .image-library-preview {
        min-height: 188px;
    }
}

/* Neutral Cancel Button */
.cancel-btn {
    background: linear-gradient(135deg, #888 0%, #444 100%);
    color: #fff !important;
    border: 2px solid #888;
    box-shadow: 0 0 8px #8884, 0 0 16px #2222;
    text-shadow: 0 0 4px #fff2;
    font-weight: bold;
    letter-spacing: 1px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    opacity: 0.93;
}
.cancel-btn:hover, .cancel-btn:focus {
    background: linear-gradient(135deg, #666 0%, #222 100%);
    border-color: #666;
    box-shadow: 0 0 16px #8888, 0 0 24px #2224;
    color: #fff !important;
    opacity: 1;
}

.cyber-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: var(--ha-management-action-radius);
    border: 1px solid var(--ha-management-danger-border);
    background: var(--ha-management-danger-bg);
    color: var(--ha-management-danger-text) !important;
    box-shadow: var(--ha-management-danger-shadow);
    text-shadow: 0 0 10px rgba(255, 188, 211, 0.14);
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.cyber-danger:hover, .cyber-danger:focus {
    background: var(--ha-management-danger-bg-hover);
    border-color: var(--ha-management-danger-border-hover);
    box-shadow: 0 0 22px rgba(226, 126, 170, 0.2), 0 8px 18px rgba(0, 0, 0, 0.16);
    color: #fff3f7 !important;
}

/*マネージメントセクション*/
.my-characters-manage {
    height: auto;
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.management-card {
    background: #0a1a2a;
    border-radius: 10px;
    padding: 16px 15vw;
    margin-bottom: 18px;
    max-width: 60%;
    margin-left: auto;
    margin-right: auto;
}

.management-card-title {
    font-weight: bold;
    color: #00f0ff;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.management-character-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.my-character-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    cursor: grab;
    background: #112244;
    border-radius: 6px;
    padding: 4px 6px;
}

.my-character-item.placeholder {
    background: #224466;
}

.my-character-item.dragging {
    position: relative;
    z-index: 1000;
    pointer-events: none;
}

.drag-handle {
    cursor: grab;
}

.my-character-name {
    flex: 1;
}

.toggle-radio-group--compact {
    display: inline-flex;
    gap: 2px;
}

.toggle-radio-btn--compact {
    font-size: 0.95em;
    color: #00f0ff;
    cursor: pointer;
}

.editor-management-card {
    width: var(--ha-management-shell-width);
    margin: 0 auto 24px;
    padding: 18px 20px 20px;
    border-radius: 18px;
    border: 1px solid rgba(0, 164, 255, 0.42);
    background: linear-gradient(180deg, rgba(6, 19, 39, 0.98) 0%, rgba(4, 16, 31, 0.95) 100%);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.editor-management-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.editor-management-card-title {
    margin: 0;
    color: #00f0ff;
}

.editor-management-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(64vh, 720px);
    overflow-y: auto;
    padding-right: 12px;
    box-sizing: border-box;
    width: 100%;
    scrollbar-gutter: stable;
}

.editor-management-item {
    --editor-management-fixed-button-width: 78px;
    --editor-management-view-button-width: 132px;
    --editor-management-control-height: 36px;
    --management-toggle-width: clamp(164px, 12vw, 198px);
    --management-actions-width: clamp(248px, 20vw, 332px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(10, 24, 46, 0.96);
    border: 1px solid rgba(0, 160, 255, 0.34);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.editor-management-item--fanart {
    grid-template-columns: 28px 78px minmax(0, 1fr) var(--management-toggle-width) var(--management-actions-width);
}

.editor-management-item--character {
    grid-template-columns: 28px 62px minmax(0, 1fr) var(--management-toggle-width) var(--management-actions-width);
}

.editor-management-item--world {
    --management-actions-width: clamp(320px, 25vw, 420px);
    grid-template-columns: 28px 52px minmax(0, 1fr) var(--management-toggle-width) var(--management-actions-width);
}

.editor-management-item.is-dragging {
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.32);
    opacity: 0.96;
}

.editor-management-item.is-placeholder {
    border-style: dashed;
    border-color: rgba(0, 240, 255, 0.55);
    background: rgba(20, 52, 92, 0.72);
}

.editor-management-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(0, 160, 255, 0.18);
    color: #00f0ff;
    font-weight: 700;
}

.editor-management-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: #9fd7ff;
    cursor: grab;
    font-size: 1.2rem;
    line-height: 1;
    user-select: none;
}

body.dragging .editor-management-drag-handle {
    cursor: grabbing;
}

.editor-management-thumb-wrap {
    width: 78px;
    height: 78px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 160, 255, 0.42);
    background: rgba(5, 15, 28, 0.92);
}

.editor-management-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.editor-management-thumb-wrap--character {
    width: 62px;
    height: 62px;
    border-radius: 14px;
}

.editor-management-thumb-wrap--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, rgba(0, 195, 255, 0.26) 0%, rgba(6, 22, 44, 0.96) 100%);
}

.editor-management-thumb-placeholder {
    color: #e8f8ff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.editor-management-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.editor-management-title-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.editor-management-title-text {
    color: #f3fbff;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-management-meta,
.editor-management-filename {
    color: #9fd7ff;
    font-size: 0.9rem;
    min-width: 0;
}

.editor-management-item--fanart .editor-management-meta {
    white-space: nowrap;
}

.editor-management-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-management-summary {
    color: #d8f6ff;
    line-height: 1.5;
}

.editor-management-visibility {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: var(--management-toggle-width);
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    align-items: center;
    justify-self: center;
    justify-content: center;
    box-sizing: border-box;
}

.editor-management-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: var(--management-actions-width);
    min-width: 0;
    justify-self: center;
    justify-content: center;
    flex-wrap: nowrap;
    box-sizing: border-box;
}

.editor-management-empty {
    color: #d8f6ff;
    line-height: 1.7;
}

.editor-management-card-head--compact {
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 160, 255, 0.2);
}

.editor-management-card-title--compact {
    color: #e7f8ff;
    font-size: clamp(1.02rem, 1.15vw, 1.2rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.35;
}

.editor-management-card-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    flex: 0 0 auto;
}

.editor-management-plus-btn {
    flex: 0 0 48px;
    min-height: 40px;
    min-width: 48px;
    width: 48px;
    padding: 0;
    font-size: 1.45rem !important;
    line-height: 1;
}

.editor-management-action-form {
    display: flex;
    flex: 0 0 var(--editor-management-fixed-button-width);
    min-width: 0;
    margin: 0;
}

.editor-management-action-form .editor-management-action-btn {
    width: 100%;
}

.editor-management-visibility-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    min-height: var(--editor-management-control-height);
    padding: 6px 8px;
    border-width: 1px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    text-shadow: none;
    box-shadow: none;
    text-decoration: none;
    cursor: pointer;
}

.editor-management-visibility-btn--public {
    border-color: rgba(94, 214, 158, 0.5);
    background: rgba(15, 49, 36, 0.52);
    color: #bdeed4;
}

.editor-management-visibility-btn--private {
    border-color: rgba(255, 120, 120, 0.48);
    background: rgba(60, 24, 24, 0.46);
    color: #ffd2d2;
}

.editor-management-visibility .editor-management-visibility-btn:hover,
.editor-management-visibility .editor-management-visibility-btn:focus {
    color: #ffffff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.04);
}

.editor-management-visibility input[type="radio"]:checked + .editor-management-visibility-btn--public {
    border-color: rgba(102, 235, 172, 0.92);
    background: linear-gradient(180deg, rgba(24, 108, 70, 0.96) 0%, rgba(14, 74, 48, 0.98) 100%);
    color: #f3fff8;
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.24);
}

.editor-management-visibility input[type="radio"]:checked + .editor-management-visibility-btn--private {
    border-color: rgba(255, 132, 132, 0.9);
    background: linear-gradient(180deg, rgba(123, 44, 53, 0.96) 0%, rgba(82, 26, 32, 0.98) 100%);
    color: #fff5f5;
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.22);
}

.ha-action-btn,
.editor-management-action-btn,
.admin-action-btn,
.admin-action-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border: 1px solid var(--ha-management-action-border);
    border-radius: var(--ha-management-action-radius);
    background: var(--ha-management-action-bg);
    color: var(--ha-management-action-text) !important;
    box-shadow: var(--ha-management-action-shadow);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.03em;
    text-shadow: 0 0 12px rgba(92, 214, 255, 0.12);
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ha-action-btn,
.editor-management-action-btn {
    flex: 0 1 auto;
    min-height: var(--editor-management-control-height);
    padding: 6px 10px;
    font-size: 0.8rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ha-action-btn--sm {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 0.72rem !important;
    letter-spacing: 0.04em;
}

.ha-action-btn--lg,
.admin-action-btn {
    min-height: 42px;
    padding: 8px 18px;
}

.admin-action-small {
    min-height: 38px;
    padding: 6px 14px;
    font-size: 0.78rem !important;
}

.ha-action-btn:hover,
.ha-action-btn:focus-visible,
.editor-management-action-btn:hover,
.editor-management-action-btn:focus-visible,
.admin-action-btn:hover,
.admin-action-btn:focus-visible,
.admin-action-small:hover,
.admin-action-small:focus-visible {
    border-color: var(--ha-management-action-border-hover);
    background: var(--ha-management-action-bg-hover);
    color: var(--ha-management-action-text-strong) !important;
    box-shadow: var(--ha-management-action-shadow-hover);
    outline: none;
}

.ha-action-btn[aria-pressed="true"] {
    border-color: var(--ha-management-action-border-hover);
    background: var(--ha-management-action-bg-hover);
    color: var(--ha-management-action-text-strong) !important;
    box-shadow: var(--ha-management-action-shadow-hover);
}

.editor-management-action-btn--edit,
.editor-management-action-btn--danger {
    flex: 0 0 var(--editor-management-fixed-button-width);
}

.editor-management-action-btn--view {
    flex: 1 1 var(--editor-management-view-button-width);
}

.ha-action-btn--danger,
.editor-management-action-btn--danger,
.cyber-danger.ha-action-btn,
.cyber-danger.editor-management-action-btn,
.cyber-danger.admin-action-btn,
.cyber-danger.admin-action-small {
    border-color: var(--ha-management-danger-border);
    background: var(--ha-management-danger-bg);
    color: var(--ha-management-danger-text) !important;
    box-shadow: var(--ha-management-danger-shadow);
    text-shadow: 0 0 10px rgba(255, 188, 211, 0.14);
}

.ha-action-btn--danger:hover,
.ha-action-btn--danger:focus-visible,
.cyber-danger.ha-action-btn:hover,
.cyber-danger.ha-action-btn:focus-visible,
.editor-management-action-btn--danger:hover,
.editor-management-action-btn--danger:focus-visible,
.cyber-danger.editor-management-action-btn:hover,
.cyber-danger.editor-management-action-btn:focus-visible,
.cyber-danger.admin-action-btn:hover,
.cyber-danger.admin-action-btn:focus-visible,
.cyber-danger.admin-action-small:hover,
.cyber-danger.admin-action-small:focus-visible {
    border-color: var(--ha-management-danger-border-hover);
    background: var(--ha-management-danger-bg-hover);
    color: #fff3f7 !important;
    box-shadow: 0 0 22px rgba(226, 126, 170, 0.2), 0 8px 18px rgba(0, 0, 0, 0.16);
}

.small-btn-offset {
    margin-left: 4px;
}

.empty-character-note {
    color: #888;
}

.card-size-buttons--flush {
    margin: 0;
}

.character-name-row-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.2em;
}




/* 画像表示モーダル（#myModal）: css/components/image-modal.css */













/* --- 強制上書き: 画像管理テーブル内の赤ボタン --- */
/* ユーザー情報を編集フォームの横幅を強制的に広げる 
#user-edit-form .edit-character-form {
    max-width: 1000px !important;
}*/

/* --- index.phpから移動: 追加・差分スタイル --- */

/* --- Forms (補助) --- */
/* キャラクター追加・編集フォームを中央寄せ */
.character-form-center {
    /*display: flex;*/
    width: min(1400px, 100%);
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--ha-editor-shell-gutter) 24px;
    box-sizing: border-box;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 32px;
    min-height: 0;
    height: auto;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges;
}

.content[data-page="uploads_list"] .character-form-center--hub,
.content[data-page="management"] .character-form-center--hub {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
}

.content[data-page="uploads_list"] .character-form-center--hub .editor-mode-selector,
.content[data-page="management"] .character-form-center--hub .editor-mode-selector {
    margin: 0 auto;
}


/* --- 横並びフォーム用 (差分) --- */
.form-row {
    margin-bottom: 1vh;
    gap: 0.5vw;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 2vh;
}
.form-row > button[type="submit"], 
.form-row > button[type="submit"].back-to-top {
    flex: 0 0 10%;
    min-width: 80px;
    min-height: 60px;
    height: auto;
    align-self: stretch;
    font-size: 1.2em;
    border-radius: 0 8px 8px 0;
    margin-left: auto;
    margin-right: 0;
    box-shadow: 0 0 12px #00c8ff55;
}
.form-row > label,
.form-row > input,
.form-row > textarea,
.form-row > .toggle-radio-group {
    flex: 1 1 90%;
    max-width: 90%;
    /*height: 2.5vh;*/
}
.form-row label {
    flex: 0 0 12em;
    margin-bottom: 0;
    margin-right: 1em;
    text-align: right;
    display: flex;
    align-items: center;
}
.form-row input,
.form-row textarea,
.form-row .toggle-radio-group {
    flex: 1;
}

.ha-image-picker-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.form-row > .ha-image-picker-field {
    flex: 1 1 90%;
    max-width: 90%;
}

.ha-image-picker-field > input,
.ha-image-picker-field > select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.ha-image-picker-trigger {
    flex: 0 0 auto;
    min-width: 112px;
    white-space: nowrap;
}
.toggle-radio-group {
    display: flex;
    flex-direction: row;
    gap: 18px;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 40px;
    justify-content: flex-start;
}
.toggle-radio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    max-width: 100%;
    padding: 8px 18px;
    font-size: 1.1em;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    border: 2px solid #00a0ff;
    border-radius: 4px;
    background: rgba(0, 30, 60, 0.85);
    color: #00f0ff;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

.small-btn,
.admin-manage-tab,
.editor-quick-switch-link,
.cyber-danger,
.editor-management-visibility-btn,
.editor-management-action-btn,
.admin-action-btn,
.admin-action-small,
.toggle-radio-btn {
    align-content: center;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}
.toggle-radio-btn:active,
.toggle-radio-btn:focus,
.toggle-radio-btn:hover {
    background: rgba(0, 80, 160, 0.9);
    color: #fff;
    border-color: #00f0ff;
}

/* --- Custom Radio Toggle Button --- */
.toggle-radio-group input[type="radio"] {
    display: none;
}
.toggle-radio-group input[type="radio"]:checked + label.toggle-radio-btn {
    background: linear-gradient(90deg, rgba(0,240,255,0.25) 0%, rgba(0,200,255,0.25) 100%);
    color: #00f0ff;
    border-color: #00f0ff;
    box-shadow: 0 0 4px #00f0ff44, 0 0 2px #00c8ff44;
    text-shadow: 0 0 2px #fff, 0 0 1px #00c8ff;
    z-index: 1;
}



/* --- Page Loader (リロード時の真っ白対策) --- */
#page-loader {
    position: fixed;
    z-index: 9999;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #001e3c 0%, #003366 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(.4,0,.2,1);
    opacity: 1;
    pointer-events: all;
}
#page-loader.hide {
    opacity: 0;
    pointer-events: none;
}

#page-loader.is-hidden {
    display: none;
}
#page-loader .loader-spinner {
    width: 64px;
    height: 64px;
    border: 7px solid #00f0ff33;
    border-top: 7px solid #00f0ff;
    border-radius: 50%;
    animation: spin 1.1s linear infinite;
    box-shadow: 0 0 32px #00f0ff99;
}
@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

/* --- 共通の青スクロールバー --- */
.characters,
.uploads-table tbody,
.image-library,
.my-characters-manage,
.character-form-center,
.world-manage-grid,
.editor-management-card,
.editor-management-list,
.fanart-manage-page,
.world-block-editor-list,
.fanart-character-picker-list,
.fanart-selector-grid,
.cyber-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #00a0ff #001e3c;
}
.characters::-webkit-scrollbar,
.uploads-table tbody::-webkit-scrollbar,
.image-library::-webkit-scrollbar,
.my-characters-manage::-webkit-scrollbar,
.character-form-center::-webkit-scrollbar,
.world-manage-grid::-webkit-scrollbar,
.editor-management-card::-webkit-scrollbar,
.editor-management-list::-webkit-scrollbar,
.fanart-manage-page::-webkit-scrollbar,
.world-block-editor-list::-webkit-scrollbar,
.fanart-character-picker-list::-webkit-scrollbar,
.fanart-selector-grid::-webkit-scrollbar,
.cyber-scrollbar::-webkit-scrollbar {
    width: 10px;
    background: #001e3c;
    border-radius: 8px;
}
.characters::-webkit-scrollbar-thumb,
.uploads-table tbody::-webkit-scrollbar-thumb,
.image-library::-webkit-scrollbar-thumb,
.my-characters-manage::-webkit-scrollbar-thumb,
.character-form-center::-webkit-scrollbar-thumb,
.world-manage-grid::-webkit-scrollbar-thumb,
.editor-management-card::-webkit-scrollbar-thumb,
.editor-management-list::-webkit-scrollbar-thumb,
.fanart-manage-page::-webkit-scrollbar-thumb,
.world-block-editor-list::-webkit-scrollbar-thumb,
.fanart-character-picker-list::-webkit-scrollbar-thumb,
.fanart-selector-grid::-webkit-scrollbar-thumb,
.cyber-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00a0ff 0%, #00f0ff 100%);
    border-radius: 8px;
    border: 2px solid #001e3c;
    min-height: 40px;
}
.characters::-webkit-scrollbar-thumb:hover,
.uploads-table tbody::-webkit-scrollbar-thumb:hover,
.image-library::-webkit-scrollbar-thumb:hover,
.my-characters-manage::-webkit-scrollbar-thumb:hover,
.character-form-center::-webkit-scrollbar-thumb:hover,
.world-manage-grid::-webkit-scrollbar-thumb:hover,
.editor-management-card::-webkit-scrollbar-thumb:hover,
.editor-management-list::-webkit-scrollbar-thumb:hover,
.fanart-manage-page::-webkit-scrollbar-thumb:hover,
.world-block-editor-list::-webkit-scrollbar-thumb:hover,
.fanart-character-picker-list::-webkit-scrollbar-thumb:hover,
.fanart-selector-grid::-webkit-scrollbar-thumb:hover,
.cyber-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #00f0ff 0%, #00a0ff 100%);
}
.characters::-webkit-scrollbar-corner,
.uploads-table tbody::-webkit-scrollbar-corner,
.image-library::-webkit-scrollbar-corner,
.my-characters-manage::-webkit-scrollbar-corner,
.character-form-center::-webkit-scrollbar-corner,
.world-manage-grid::-webkit-scrollbar-corner,
.editor-management-card::-webkit-scrollbar-corner,
.editor-management-list::-webkit-scrollbar-corner,
.fanart-manage-page::-webkit-scrollbar-corner,
.world-block-editor-list::-webkit-scrollbar-corner,
.fanart-character-picker-list::-webkit-scrollbar-corner,
.fanart-selector-grid::-webkit-scrollbar-corner,
.cyber-scrollbar::-webkit-scrollbar-corner {
    background: #001e3c;
}

@media (max-height: 820px) {
    .content {
        min-height: 0;
        overflow-y: auto;
    }
}



/* --- ワールドタグツールチップ --- */
.world-tooltip {
  position: fixed;
  z-index: 99999;
  background: rgba(30,30,30,0.98);
  color: #ffb347;
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 12px #0008;
  font-size: 1em;
  max-width: 40vw;
  display: none;
  pointer-events: none;
  white-space: pre-line;
}

.world-tooltip.is-visible {
  display: block;
}

/* --- 文字数カウント --- */
/* --- テキストエリア＋カウント横並び --- */
.textarea-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  width: 100%;
  min-width: 220px;
}
.textarea-row textarea {
  flex: 0 1 80%;
  min-width: 0;
  width: 80%;
  margin-bottom: 0;
  margin-right: 0;
  box-sizing: border-box;
}
.char-count {
  color: #888;
  font-size: 0.95em;
  flex: 0 1 20%;
  min-width: 60px;
  max-width: 200px;
  margin: 0 0 0 12px;
  text-align: left;
  min-height: 1.2em;
  transition: color 0.2s;
  align-self: center;
  padding-left: 2px;
  box-sizing: border-box;
}
.char-count.over {
  color: #ff9800;
  font-weight: bold;
}

@media (orientation: portrait) and (max-width: 1500px) {
  .editor-management-list {
    max-height: none;
    padding-right: 0;
  }

  .editor-management-card-title--compact {
    font-size: 1.14rem;
  }

  .editor-quick-switch-link {
    font-size: 0.94rem !important;
    min-height: 44px;
  }
}
