:root {
    --bg-a: #f4f6f8;
    --bg-b: #e8eef5;
    --ink: #10213a;
    --muted: #5f6d82;
    --line: #d5dfeb;
    --card: #ffffffcc;
    --brand: #0f3a6e;
    --brand-2: #1f6fb2;
    --ok-bg: #eefcf3;
    --ok-line: #9ddfb5;
    --ok-ink: #155f33;
    --err-bg: #fff1f1;
    --err-line: #f0b4b4;
    --err-ink: #8c2323;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    color: var(--ink);
    font-family: "M PLUS 1p", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    background:
        radial-gradient(1200px 700px at 10% -10%, #dce7f5 0%, transparent 60%),
        radial-gradient(900px 600px at 100% 0%, #d8efe8 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-a), var(--bg-b));
    min-height: 100vh;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 26px 18px 40px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    backdrop-filter: blur(5px);
    box-shadow:
        0 0 0 1px rgba(16, 33, 58, 0.04),
        0 1px 3px rgba(16, 33, 58, 0.06),
        0 4px 16px rgba(16, 33, 58, 0.06);
    transition: box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-title {
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.subtle {
    color: var(--muted);
    font-size: 13px;
}

.flash-ok {
    border-color: var(--ok-line);
    background: var(--ok-bg);
    color: var(--ok-ink);
}

.flash-err {
    border-color: var(--err-line);
    background: var(--err-bg);
    color: var(--err-ink);
}

.sv-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.sv-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sv-nav-link {
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    background: #fff8;
    transition: background 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.sv-nav-link:hover {
    background: #fff;
    border-color: #b8c9de;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 33, 58, 0.06);
}

.sv-nav-link:active {
    transform: translateY(0) scale(0.98);
    box-shadow: none;
}

.sv-nav-link.active {
    color: #fff;
    border-color: var(--brand);
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* モバイル用 select/プルダウン – デスクトップでは非表示 */
.sv-nav-select,
.dashboard-period-mobile,
.df-compare-mode-select {
    display: none;
}

.sv-nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pill {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2px 9px;
    font-size: 12px;
    background: #fff9;
    white-space: nowrap;
}

.grid {
    display: grid;
    gap: 12px;
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1000px) {
    .grid.cols-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .grid.cols-3 {
        grid-template-columns: 1fr;
    }
}

form.inline,
.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

label {
    font-size: 13px;
    color: var(--muted);
}

input, select, textarea {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 10px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    transition: border-color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

input:hover, select:hover, textarea:hover {
    border-color: #b8c9de;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6aa1d7;
    box-shadow: 0 0 0 4px rgba(66, 133, 201, 0.12);
}

.btn {
    display: inline-block;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 9px 12px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    font-weight: 600;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 58, 110, 0.2);
    filter: brightness(1.06);
}

.btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: none;
    filter: brightness(0.97);
}

.btn.secondary {
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
}

.btn.danger {
    border-color: #c54c4c;
    background: #fff;
    color: #9d2525;
}

.btn.small {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th, td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    vertical-align: top;
    font-size: 13px;
}

th {
    color: #3b4a63;
    background: #f6f9fd;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #f0f4fa;
}

tr.account-imported {
    background: #f3fbf6;
}

.import-state {
    margin-bottom: 6px;
}

.accounts-table td {
    padding-top: 16px;
    padding-bottom: 16px;
}

.account-external-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    color: #31435d;
    background: #f6f9fd;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 3px 8px;
    display: inline-block;
}

.account-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.account-actions .btn {
    min-width: 92px;
    text-align: center;
}

.account-status-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.account-status-form select {
    min-width: 140px;
}

.status-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2d3f5a;
}

.badge {
    display: inline-block;
    border-radius: 8px;
    padding: 2px 9px;
    font-size: 12px;
    border: 1px solid var(--line);
    white-space: nowrap;
}

.badge-ok {
    color: #155f33;
    background: #eaf8ef;
    border-color: #9ddfb5;
}

.badge-idle {
    color: #5f6d82;
    background: #f4f6f9;
}

.metric-number {
    font-size: 30px;
    font-weight: 700;
}

.ok { color: #18613b; }
.warn { color: #8b5d16; }
.err { color: #8e2525; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #e8eef6 0%, #f0f4fa 40%, #eef0f8 100%);
}

.login-hero {
    margin-bottom: 36px;
}
.login-hero-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.login-logo {
    flex-shrink: 0;
}
.login-logo svg {
    display: block;
    filter: drop-shadow(0 6px 18px rgba(10,37,64,0.3));
}
.login-brand-text {
    text-align: left;
    border-left: 3px solid;
    border-image: linear-gradient(180deg, #1a73e8, #4fc3f7) 1;
    padding-left: 16px;
}
.login-brand {
    margin: 0;
    line-height: 1;
}
.brand-main {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1a2b3f;
}
.login-tagline {
    font-size: 12px;
    color: #8a929a;
    margin: 6px 0 0;
    letter-spacing: 0.06em;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 32px 32px 28px;
    border-radius: 16px;
    background: #ffffffee;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(15,30,52,0.10), 0 1px 4px rgba(15,30,52,0.04);
    border: 1px solid rgba(15,58,110,0.08);
}

.login-card-title {
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--text, #1c2a3a);
    margin-bottom: 8px;
}

.login-card .page-title {
    text-align: center;
    font-size: 20px;
    margin-bottom: 2px;
}

.login-card .subtle {
    text-align: center;
    margin-bottom: 20px;
}

.login-card label {
    display: block;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.login-card input[type="email"],
.login-card input[type="password"] {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d1d9e4;
    border-radius: 10px;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15,58,110,0.1);
    background: #fff;
}

.login-card .flash-err {
    margin-top: 16px;
    margin-bottom: -4px;
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.login-card .cf-turnstile {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.login-footer {
    margin-top: 20px;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.login-footer a {
    color: var(--muted);
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--brand);
    text-decoration: underline;
}

.login-footer span {
    margin: 0 6px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

.section-title {
    margin: 18px 0 8px;
    font-size: 17px;
    letter-spacing: 0.01em;
}

.status-set {
    color: #c02121;
    font-weight: 700;
}

.status-unset {
    color: #5f6d82;
}

.dashboard-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 8px;
}

/* ─── Dashboard Filter Console v2 ─── */
.df-form {
    background: #eef2f7;
    padding: 0;
}

.df-row {
    padding: 12px 18px;
}

.df-row + .df-row {
    border-top: 1px solid #dde3eb;
}

.df-row.is-hidden {
    display: none;
}

/* Row 1: period + compare toggle */
.df-row-period {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.df-group-dates {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 14px;
}

.df-label {
    font-size: 12px;
    font-weight: 700;
    color: #3b4a63;
    white-space: nowrap;
}

.df-date-pair {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.df-date-sep {
    color: #8895a7;
    font-size: 14px;
}

.df-date-pair input[type="date"] {
    border: 1px solid #d5dfeb;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    background: #f8fafc;
    color: var(--ink);
    min-width: 140px;
    cursor: pointer;
}

.df-date-pair input[type="date"]:focus {
    outline: none;
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15,58,110,0.08);
}

/* Compare toggle switch */
.df-compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 6px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
    transition: border-color 0.15s, background 0.15s;
}

.df-compare-toggle:has(input:checked) {
    border-color: #2e6db4;
    background: #edf4ff;
}

.df-compare-toggle-text {
    font-size: 13px;
    font-weight: 600;
    color: #3b4a63;
}

.df-compare-toggle:has(input:checked) .df-compare-toggle-text {
    color: #1a4d85;
}

.df-switch {
    position: relative;
    display: inline-flex;
}

.df-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.df-switch-track {
    display: block;
    width: 38px;
    height: 22px;
    border-radius: 11px;
    background: #c8d0db;
    transition: background 0.2s;
    position: relative;
}

.df-switch input:checked + .df-switch-track {
    background: #2e6db4;
}

.df-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.df-switch input:checked + .df-switch-track .df-switch-thumb {
    transform: translateX(16px);
}

/* Row 2: compare settings */
.df-row-compare {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: #e8eef6;
    padding: 10px 18px;
}

.df-compare-modes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.df-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #c8d0db;
    border-radius: 20px;
    background: #fff;
    color: #3b4a63;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.df-chip:hover {
    border-color: #9fb0c6;
    background: #f0f5fb;
}

.df-chip.is-active {
    border-color: #2e6db4;
    background: #2e6db4;
    color: #fff;
}

.df-compare-dates {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 14px;
}

.df-compare-dates.is-hidden {
    display: none;
}

/* Row 3: filters */
.df-row-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.df-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.df-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7a8d;
    padding-left: 2px;
}

.df-filter select {
    min-width: 130px;
    padding: 7px 28px 7px 10px;
    font-size: 13px;
    border: 1px solid #d5dfeb;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235f6d82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 10px center / 10px no-repeat;
    color: var(--ink);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s;
}

.df-filter select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15,58,110,0.08);
}

.df-filter-wide {
    flex: 1;
    min-width: 250px;
}

.df-filter-wide select {
    width: 100%;
}

@media (max-width: 1000px) {
    .df-row-period {
        flex-direction: column;
        align-items: stretch;
    }
    .df-group-dates {
        flex-wrap: wrap;
    }
    .df-row-filters {
        flex-direction: column;
    }
    .df-filter {
        width: 100%;
    }
    .df-filter select {
        width: 100%;
    }
}

.dashboard-hero {
    background: #f3f5f8;
    border-color: #d9dee6;
    box-shadow: none;
    padding: 0;
    overflow: visible;
    position: relative;
    z-index: 10;
}

.dashboard-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 0;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #dde3eb;
}

.dashboard-head-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    min-width: 220px;
}

.dashboard-hero-meta {
    color: #5f6d82;
    font-size: 13px;
    white-space: nowrap;
    margin-top: 0;
    padding-right: 2px;
}

.period-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}

.dashboard-period-switch {
    padding: 10px 18px;
    margin: 0;
    border-bottom: 1px solid #dde3eb;
    background: #eef2f7;
}

.dashboard-period-switch .btn.secondary {
    background: #fff;
    border-color: #c8d0db;
    min-width: 80px;
    text-align: center;
    border-radius: 8px;
    font-weight: 500;
}

.dashboard-period-switch .btn.secondary.active-pill {
    border-color: #6f7b8a;
    background: #dce5f2;
    color: #14263d;
}

.dashboard-period-switch .dashboard-reset-link {
    margin-left: auto;
    background: #f8fafc;
    border-color: #b9c5d5;
    color: #314862;
}

.dashboard-period-switch .dashboard-reset-link:hover {
    background: #edf2f8;
    border-color: #9fb0c6;
}

.dashboard-filter-console {
    padding: 12px 18px;
    border: 0;
    border-radius: 0;
    background: #eef2f7;
    margin-top: 0;
}

.btn.secondary.active-pill {
    border-color: var(--brand);
    color: #fff;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.dashboard-period-switch .btn.secondary.active-pill {
    border-color: #6f7b8a;
    background: #dce5f2;
    color: #14263d;
}

.range-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
}

.range-label {
    font-size: 12px;
    color: #3b4a63;
    font-weight: 700;
    min-width: 56px;
}

.range-group select {
    min-width: 170px;
}

.compare-period-details {
    min-width: 270px;
    cursor: pointer;
    align-items: stretch;
}

.compare-period-details summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    width: 100%;
}

.compare-period-details summary::-webkit-details-marker {
    display: none;
}

.compare-period-details summary::after {
    content: "▾";
    color: #5f6d82;
    font-size: 11px;
    margin-left: auto;
}

.compare-period-details[open] {
    min-width: 380px;
    background: #f8fbff;
}

.compare-period-fields input[type="date"] {
    min-width: 150px;
    width: 100%;
}

.compare-summary-value {
    font-size: 12px;
    color: #40516d;
    font-weight: 600;
}

.compare-mode-label {
    font-size: 11px;
    color: #2e5b8f;
    font-weight: 700;
    background: #eaf2ff;
    border: 1px solid #c9dbf5;
    border-radius: 999px;
    padding: 2px 8px;
}

.compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 12px;
    color: #334861;
    cursor: pointer;
}

.compare-period-details.is-disabled {
    opacity: 0.75;
}

.compare-period-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.compare-mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.compare-mode-btn {
    font-size: 12px;
    padding: 7px 10px;
}

.compare-mode-switch .btn.secondary.active-pill {
    border-color: #6f7b8a;
    background: #dce5f2;
    color: #14263d;
}

.dashboard-submit {
    min-width: 84px;
}

.export-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-export-actions {
    border-top: 1px solid #dde3eb;
    padding: 10px 18px 14px;
    margin-top: 0;
    background: #eef2f7;
    display: flex;
    justify-content: flex-end;
}

.console-export {
    position: relative;
}

.console-export summary {
    list-style: none;
    cursor: pointer;
}

.console-export summary::-webkit-details-marker {
    display: none;
}

.console-export summary::before {
    content: "⬇ ";
    font-size: 12px;
}

.console-export-menu {
    position: absolute;
    right: 0;
    margin-top: 8px;
    min-width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px;
    background: var(--bg-a);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(15, 30, 52, 0.15), 0 2px 8px rgba(15, 30, 52, 0.08);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    z-index: 100;
}

.console-export-title {
    font-size: 11px;
    font-weight: 600;
    color: #8895a7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px 6px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 2px;
}

.console-export-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    width: 100%;
    text-align: left;
    text-decoration: none;
    color: #1e2d3d;
    padding: 9px 12px;
    transition: background 0.15s, box-shadow 0.15s;
}

.console-export-link.is-disabled {
    color: #8a97ab;
    background: #f7f9fc;
    border-color: #e4e9f1;
    pointer-events: none;
}

.console-export-link::before {
    content: "";
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--bg-b) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%234b6a9b' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h8M8 9h2'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.console-export-link:hover {
    background: var(--bg-b);
    box-shadow: 0 0 0 1px var(--line) inset;
}

.console-export-link .export-link-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.console-export-link span {
    font-size: 13px;
    font-weight: 600;
    color: #1a2b3f;
}

.console-export-link small {
    font-size: 11px;
    color: #7b8da4;
    white-space: nowrap;
}

.table-empty {
    color: var(--muted);
    text-align: center;
    padding: 18px 10px;
}

.chart-legend-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 4px 0 10px;
}

.chart-legend-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2d3f5a;
    font-size: 13px;
    background: #f7fbff;
    border: 1px solid #d8e3ef;
    border-radius: 999px;
    padding: 4px 10px;
}

.series-item {
    border-width: 2px;
    gap: 8px;
}

.series-total { background: #1a5296; }
.series-yt-shorts { background: #ef4444; }
.series-yt-longs { background: #f59e0b; }
.series-tiktok { background: #6366f1; }
.series-instagram { background: #ec4899; }
.series-compare { background: transparent; border: 2px dashed #94a3b8; }

.series-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.series-item.is-hidden {
    display: none;
}

.videos-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.videos-head .page-title {
    margin: 0;
}

.videos-head-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sort-control,
.per-page-control {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.sort-control label,
.per-page-control label {
    font-size: 12px;
    color: #64748b;
}

.sort-control select,
.per-page-control select {
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 8px;
    min-width: 80px;
}

.video-filter-active {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    padding: 6px 0 2px;
}
.video-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef3ff;
    color: #2e6db4;
    font-weight: 600;
    font-size: 12px;
    padding: 3px 8px 3px 10px;
    border-radius: 12px;
    border: 1px solid #c7d4ed;
}
.video-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #c7d4ed;
    color: #2e6db4;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s;
}
.video-filter-clear:hover {
    background: #ef4444;
    color: #fff;
}

.pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    font-size: 0.85rem;
    color: var(--muted);
}

.bulk-tag-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
    margin-bottom: 12px;
}

.bulk-tag-form label {
    font-weight: 700;
    color: #2d3f5a;
}

.bulk-tag-form button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bulk-tag-form select {
    min-width: 220px;
    width: 220px;
}

.bulk-tag-form input[type="text"] {
    min-width: 220px;
    width: 220px;
}

.bulk-tag-form .bulk-submit {
    min-width: 180px;
}

.manual-video-details {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
    padding: 8px 12px 12px;
    margin-top: 8px;
}

.manual-video-details > summary {
    cursor: pointer;
    color: #2d3f5a;
    font-weight: 700;
    list-style: none;
}

.manual-video-details > summary::-webkit-details-marker {
    display: none;
}

.manual-video-details > summary::before {
    content: "▸";
    margin-right: 6px;
    color: #466a92;
}

.manual-video-details[open] > summary::before {
    content: "▾";
}

.video-manual-form {
    margin-top: 10px;
}

.users-create-panel {
    border: 1px solid #d7e1ee;
    border-radius: 10px;
    background: #f7fbff;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.users-create-head {
    margin-bottom: 8px;
}

.users-create-head .section-title {
    margin: 0 0 4px;
    font-size: 16px;
}

.users-create-head .subtle {
    margin: 0;
}

.users-create-form {
    margin-top: 6px;
}

.users-create-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.users-create-submit {
    min-width: 110px;
}

.video-title-link {
    display: inline-block;
    max-width: 420px;
    word-break: break-word;
}

.video-tag-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 130px;
}

.video-tag-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.video-untag-form {
    margin: 0;
}

.video-tag-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr);
    gap: 8px;
    align-items: center;
}

.video-tag-form select,
.video-tag-form input[type="text"] {
    min-width: 132px;
    max-width: 220px;
}

.video-tag-form .btn {
    justify-self: start;
    min-width: 54px;
}

.accounts-table {
    min-width: 1120px;
}

.accounts-table .col-id,
.accounts-table .col-platform,
.accounts-table .col-token,
.accounts-table .col-oauth,
.accounts-table .col-import {
    white-space: nowrap;
}

.accounts-table .col-id {
    width: 52px;
}

.accounts-table .col-platform {
    width: 92px;
}

.accounts-table .col-external {
    width: 280px;
}

.accounts-table .col-name {
    min-width: 160px;
}

.accounts-table .col-token {
    width: 166px;
}

.accounts-table .col-oauth {
    width: 112px;
}

.accounts-table .col-import {
    width: 130px;
}

.accounts-table .col-status {
    min-width: 250px;
}

.accounts-table .account-status-form .btn {
    min-width: 62px;
    text-align: center;
}

/* Video table v2 – compact layout */
.videos-table.v2 {
    min-width: 780px;
}

.videos-table.v2 th,
.videos-table.v2 td {
    padding: 7px 8px;
    vertical-align: middle;
}

.videos-table.v2 th {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.vt-check {
    width: 32px;
    text-align: center;
}

.vt-video {
    min-width: 300px;
}

.vt-video-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vt-video-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.vt-video-badges .platform-badge {
    font-size: 10px;
    padding: 2px 6px;
    min-width: 26px;
    text-align: center;
}

.vt-video-badges .type-select {
    font-size: 11px;
    padding: 2px 6px;
    min-width: 68px;
    border-radius: 6px;
}

.vt-title {
    color: var(--brand);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.vt-title:hover {
    text-decoration: underline;
}

.vt-date {
    width: 90px;
    white-space: nowrap;
    font-size: 12px;
    color: var(--muted);
}

.vt-views {
    width: 110px;
    white-space: nowrap;
}

.vt-views-total {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
}

.vt-views-daily {
    display: block;
    font-size: 11px;
    color: #16a34a;
    font-weight: 600;
    margin-top: 1px;
}

.vt-tags {
    width: 180px;
}

.vt-tags-inner {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vt-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    flex: 1;
}

.vt-tags-inner .vt-tag-add-btn {
    flex-shrink: 0;
    margin-left: auto;
}

.vt-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #eef3fa;
    border: 1px solid #d0dae8;
    border-radius: 6px;
    padding: 2px 6px 2px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #2d3f5a;
    margin: 1px 2px 1px 0;
    white-space: nowrap;
}

.vt-tag-pill .video-untag-form {
    display: inline;
    margin: 0;
}

.vt-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    border-radius: 3px;
}

.vt-tag-remove:hover {
    color: #dc2626;
    background: #fee2e2;
}

.vt-tag-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px dashed #b0bfcf;
    border-radius: 6px;
    background: none;
    color: #7a8da3;
    font-size: 14px;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
}

.vt-tag-add-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: #f0f5fc;
}

.vt-actions {
    width: 64px;
    white-space: nowrap;
}

.vt-tag-form-row.is-hidden {
    display: none;
}

.vt-tag-form-row > td {
    padding: 6px 8px 8px !important;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.vt-tag-inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.vt-tag-inline-form select,
.vt-tag-inline-form input[type="text"] {
    font-size: 12px;
    padding: 5px 8px;
    min-width: 160px;
}

/* Legacy classes kept for backwards compat */
.videos-table:not(.v2) {
    min-width: 1100px;
}

.col-check {
    width: 34px;
    text-align: center;
}

.col-platform,
.col-published,
.col-metric,
.col-date,
.col-trend {
    white-space: nowrap;
}

.col-platform {
    width: 90px;
}

.platform-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    padding: 3px 8px;
    white-space: nowrap;
}

.platform-youtube {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

.platform-tiktok {
    color: #111827;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

.platform-instagram {
    color: #9333ea;
    background: #faf5ff;
    border: 1px solid #d8b4fe;
}

.videos-table .col-type {
    width: 110px;
    white-space: nowrap;
}

.video-type-form {
    margin: 0;
}

.type-select {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    min-width: 90px;
}

.type-select-short {
    color: #155f33;
    background: #eaf8ef;
    border: 1px solid #9ddfb5;
}

.type-select-long {
    color: #7c4a0e;
    background: #fef3e2;
    border: 1px solid #f0c87a;
}

.type-select-none {
    color: #5f6d82;
    background: #f4f6f9;
    border: 1px solid var(--line);
}

.videos-table .col-title {
    min-width: 260px;
}

.videos-table .col-published {
    width: 130px;
}

.videos-table .col-metric {
    width: 110px;
}

.videos-table .col-date {
    width: 110px;
}

.videos-table .col-trend {
    width: 84px;
}

.videos-table .col-tags {
    width: 160px;
}

.videos-table .col-assign {
    width: 240px;
}

@media (max-width: 1000px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .range-group {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .range-group input[type="date"] {
        flex: 1 1 44%;
        min-width: 130px;
    }

    .range-group select {
        width: 100%;
    }

    .dashboard-hero-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-head-right {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .compare-period-details {
        min-width: 100%;
    }

    .compare-period-details[open] {
        min-width: 100%;
    }

    .compare-period-fields {
        grid-template-columns: 1fr;
    }

    .compare-mode-label {
        display: none;
    }

    .dashboard-period-switch .dashboard-reset-link {
        margin-left: 0;
    }

    .accounts-table {
        min-width: 980px;
    }

    .bulk-tag-form {
        align-items: stretch;
    }

    .video-title-link {
        max-width: 280px;
    }

    .video-tag-form select,
    .video-tag-form input[type="text"] {
        max-width: 180px;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--brand);
    color: #fff;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
}

.pagination-link:hover {
    background: var(--bg-b);
}

/* Footer */
.sv-footer {
    text-align: center;
    padding: 24px 16px;
    margin-top: 40px;
    font-size: 0.82rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.sv-footer a {
    color: var(--muted);
    text-decoration: none;
}

.sv-footer a:hover {
    color: var(--brand);
    text-decoration: underline;
}

.sv-footer-sep {
    margin: 0 8px;
}

/* Check label (inline checkbox + text) */
.check-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* Badge variants */
.badge-warn {
    color: #7c4a0e;
    background: #fef3e2;
    border-color: #f0c87a;
}
.badge-err {
    color: #9b1c1c;
    background: #fde8e8;
    border-color: #f8b4b4;
}
.badge-paused {
    color: #5f6d82;
    background: #f4f6f9;
    border-color: #d1d5db;
}

.badge-unread {
    color: #1e40af;
    background: #eff6ff;
    border-color: #93c5fd;
    font-weight: 700;
}

/* Login submit */
.login-submit {
    width: 100%;
    margin-top: 20px;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    letter-spacing: 0.04em;
}

/* Audit payload cell */
.audit-payload {
    white-space: pre-wrap;
    word-break: break-all;
}

/* Tag video accordion */
.tag-videos-row.is-hidden {
    display: none;
}

.tag-videos-row > td {
    padding: 0 !important;
    background: var(--bg-b);
}

.tag-videos-panel {
    padding: 12px 18px 16px;
}

.tag-videos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tag-videos-table th {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
}

.tag-videos-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.tag-videos-table a {
    color: var(--brand);
    text-decoration: none;
}

.tag-videos-table a:hover {
    text-decoration: underline;
}

.tag-videos-toggle {
    white-space: nowrap;
    min-width: 64px;
}

/* ── Settings page ── */
.settings-status-bar {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.settings-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f8fafc;
}

.settings-status-item.is-ok {
    color: #155f33;
    background: #eaf8ef;
    border-color: #9ddfb5;
}

.settings-status-item.is-warn {
    color: #7c4a0e;
    background: #fef3e2;
    border-color: #f0c87a;
}

.settings-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line);
}

.settings-status-item.is-ok .settings-status-dot {
    background: #22c55e;
}

.settings-status-item.is-warn .settings-status-dot {
    background: #f59e0b;
}

.settings-section-head {
    margin-bottom: 14px;
}

.settings-section-title {
    margin: 0 0 4px;
    font-size: 16px;
}

.settings-limits-row {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.settings-limit-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 120px;
}

.settings-limit-item input {
    width: 100%;
}

.settings-platform-card {
    border-left: 3px solid var(--line);
}

.settings-platform-card:has(.settings-platform-youtube) {
    border-left-color: #ef4444;
}

.settings-platform-card:has(.settings-platform-tiktok) {
    border-left-color: #111827;
}

.settings-platform-card:has(.settings-platform-instagram) {
    border-left-color: #c026d3;
}

.settings-platform-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.settings-platform-title {
    margin: 0;
    font-size: 17px;
}

.settings-field-status {
    margin-top: 4px;
}

.settings-save-btn {
    min-width: 240px;
    padding: 14px 24px;
    font-size: 15px;
}

/* Comparison diff colors */
.diff-positive {
    color: #18613b !important;
}

.diff-negative {
    color: #8e2525 !important;
}

/* ─────────────────────────────────────────────
   Mobile responsive  (≤ 768px)
   ───────────────────────────────────────────── */
@media (max-width: 768px) {

    /* ── Global ── */
    .container {
        padding: 12px 8px 28px;
    }

    .card {
        padding: 14px 12px;
        border-radius: 12px;
        margin-bottom: 10px;
    }

    .page-title {
        font-size: 17px;
    }

    .subtle {
        font-size: 12px;
    }

    /* iOS: 16px以上でズームしない */
    input, select, textarea {
        font-size: 16px;
        padding: 10px;
        border-radius: 8px;
    }

    .btn {
        font-size: 14px;
        padding: 10px 14px;
        border-radius: 8px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn.small {
        font-size: 12px;
        padding: 8px 10px;
        min-height: 36px;
    }

    /* ── Nav: モバイルはプルダウン（select）方式 ── */
    .sv-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .sv-nav-links {
        display: none;
    }

    .sv-nav-select {
        display: block;
        width: 100%;
        font-size: 16px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235f6d82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 10px no-repeat;
        color: var(--ink);
        font-weight: 600;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
    }

    .sv-nav-user {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .sv-nav-user .pill {
        font-size: 12px;
    }

    .sv-nav-user .btn {
        font-size: 12px;
        min-height: 36px;
        padding: 6px 12px;
    }

    /* ── Grid ── */
    .grid {
        gap: 8px;
    }

    /* ── Metric cards ── */
    .metric-number {
        font-size: 26px;
    }

    /* ── Form grid ── */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* テーブル外のinlineフォームのみスタック */
    .card > form.inline,
    .card > .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .card > form.inline .btn,
    .card > .filters .btn {
        width: 100%;
    }

    /* ── Flash messages ── */
    .flash-ok,
    .flash-err {
        font-size: 13px;
        padding: 12px;
    }

    /* ── Dashboard hero ── */
    .dashboard-hero {
        border-radius: 12px;
    }

    .dashboard-hero-head {
        padding: 12px 12px 10px;
        gap: 10px;
    }

    .dashboard-hero-head .page-title {
        font-size: 16px;
    }

    .dashboard-hero-head .subtle {
        font-size: 11px;
    }

    .dashboard-head-right {
        min-width: 0;
        width: 100%;
        flex-direction: row;
        align-items: center;
    }

    .dashboard-hero-meta {
        font-size: 11px;
    }

    /* ── Period switch → プルダウン ── */
    .dashboard-period-switch {
        display: none;
    }

    .dashboard-period-mobile {
        display: block;
        padding: 8px 12px;
        background: #eef2f7;
        border-bottom: 1px solid #dde3eb;
    }

    .dashboard-period-select {
        width: 100%;
        font-size: 16px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235f6d82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 10px no-repeat;
        color: var(--ink);
        font-weight: 600;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
    }

    /* ── Dashboard filter form ── */
    .df-row {
        padding: 10px 12px;
    }

    .df-row-period {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .df-group-dates {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 6px;
    }

    .df-label {
        font-size: 11px;
    }

    .df-date-pair {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .df-date-pair input[type="date"] {
        flex: 1;
        min-width: 0;
        font-size: 14px;
        padding: 8px;
    }

    .df-compare-toggle {
        padding: 8px 12px;
        align-self: stretch;
        justify-content: center;
    }

    .df-compare-toggle-text {
        font-size: 13px;
    }

    /* Row 2: compare settings */
    .df-row-compare {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 12px;
        gap: 8px;
    }

    .df-compare-modes {
        display: none;
    }

    .df-compare-mode-select {
        display: block;
        width: 100%;
        font-size: 16px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235f6d82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 10px no-repeat;
        color: var(--ink);
        font-weight: 600;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
    }

    .df-compare-dates {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 6px;
    }

    /* Row 3: filters */
    .df-row-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .df-filter {
        width: 100%;
    }

    .df-filter select {
        width: 100%;
        min-width: 0;
        font-size: 14px;
    }

    .df-filter-wide {
        min-width: 0;
    }

    .df-filter-wide select {
        font-size: 14px;
    }

    .df-filter-label {
        font-size: 11px;
    }

    .dashboard-submit {
        min-width: 0;
        width: 100%;
        font-size: 14px;
    }

    /* ── Export ── */
    .dashboard-export-actions {
        padding: 8px 12px 10px;
    }

    .console-export-menu {
        min-width: 0;
        width: calc(100vw - 40px);
        max-width: 340px;
        right: -8px;
    }

    .console-export-link {
        padding: 10px 12px;
    }

    .console-export-link span {
        font-size: 13px;
    }

    .console-export-link small {
        font-size: 10px;
    }

    /* ── Chart ── */
    .chart-legend-toggles {
        gap: 4px 6px;
        margin: 4px 0 8px;
    }

    .chart-legend-toggles label {
        font-size: 11px;
        padding: 4px 8px;
        gap: 4px;
    }

    .series-dot {
        width: 8px;
        height: 8px;
    }

    canvas#dailyChart {
        max-height: 200px;
    }

    /* ── Videos page ── */
    .videos-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .videos-head-controls {
        width: 100%;
        justify-content: space-between;
    }

    .sort-control select,
    .per-page-control select {
        font-size: 14px;
        min-width: 90px;
    }

    /* bulk tag form */
    .bulk-tag-form {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        gap: 8px;
    }

    .bulk-tag-form label {
        font-size: 13px;
    }

    .bulk-tag-form select,
    .bulk-tag-form input[type="text"] {
        min-width: 0;
        width: 100%;
        font-size: 14px;
    }

    .bulk-tag-form .bulk-submit {
        min-width: 0;
        width: 100%;
    }

    /* manual video form */
    .manual-video-details {
        padding: 8px 10px;
    }

    .manual-video-details > summary {
        font-size: 14px;
    }

    /* Video table v2 */
    .videos-table.v2 {
        min-width: 620px;
    }

    .videos-table.v2 th,
    .videos-table.v2 td {
        padding: 8px 6px;
    }

    .vt-video {
        min-width: 200px;
    }

    .vt-video-badges .platform-badge {
        font-size: 9px;
        padding: 2px 5px;
    }

    .vt-video-badges .type-select {
        font-size: 10px;
        padding: 2px 4px;
        min-width: 58px;
    }

    .vt-title {
        font-size: 12px;
    }

    .vt-date {
        width: 72px;
        font-size: 11px;
    }

    .vt-views {
        width: 90px;
    }

    .vt-views-total {
        font-size: 13px;
    }

    .vt-views-daily {
        font-size: 10px;
    }

    .vt-tags {
        width: 120px;
    }

    .vt-tag-pill {
        font-size: 11px;
        padding: 2px 4px 2px 6px;
    }

    .vt-actions {
        width: 54px;
    }

    .vt-actions .btn {
        font-size: 11px;
        padding: 6px 8px;
        min-height: 32px;
    }

    /* Tag inline form row */
    .vt-tag-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .vt-tag-inline-form select,
    .vt-tag-inline-form input[type="text"] {
        min-width: 0;
        width: 100%;
        font-size: 14px;
    }

    .vt-tag-inline-form .btn {
        width: 100%;
    }

    /* ── Tags page ── */
    .tags-table {
        min-width: 580px;
    }

    .tags-hide-mobile {
        display: none;
    }

    .tag-videos-panel {
        padding: 10px 8px;
    }

    .tag-videos-table {
        font-size: 12px;
        min-width: 0;
    }

    .tag-videos-table th,
    .tag-videos-table td {
        padding: 6px 6px;
    }

    .tag-videos-toggle {
        min-width: 56px;
        font-size: 12px;
    }

    /* ── Accounts page ── */
    .accounts-table {
        min-width: 820px;
    }

    .accounts-table td {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .account-status-form {
        flex-wrap: wrap;
        gap: 6px;
    }

    .account-status-form select {
        min-width: 110px;
        font-size: 14px;
    }

    .account-actions .btn {
        min-width: 76px;
        font-size: 12px;
    }

    /* ── Users page ── */
    .users-create-panel {
        padding: 10px;
    }

    .users-create-head .section-title {
        font-size: 15px;
    }

    /* ── Reports page ── */
    .report-share-input {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        font-size: 12px;
    }

    /* ── Sync page ── */
    /* inherit from general table styles */

    /* ── Audit page ── */
    .audit-payload {
        font-size: 11px;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .filters {
        gap: 6px;
    }

    .filters input[type="text"],
    .filters input[type="date"],
    .filters select {
        width: 100%;
    }

    /* ── Notifications page ── */
    /* inherit from general table styles */

    /* ── Tables general ── */
    table {
        min-width: 480px;
    }

    /* SNS比較等、cols-2内のシンプルなテーブルは幅制限不要 */
    .grid.cols-2 table {
        min-width: 0;
    }

    th, td {
        padding: 8px 6px;
        font-size: 12px;
    }

    th {
        font-size: 11px;
    }

    .table-wrap {
        margin: 0 -12px;
        padding: 0 12px;
        border-radius: 0;
    }

    /* ── Pagination ── */
    .pagination {
        flex-wrap: wrap;
        gap: 3px;
    }

    .pagination-current,
    .pagination-link {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }

    /* ── Footer ── */
    .sv-footer {
        padding: 16px 12px;
        margin-top: 20px;
        font-size: 11px;
    }

    /* ── Login page ── */
    .login-card {
        max-width: 100%;
        padding: 28px 20px 24px;
    }

    .login-card .page-title {
        font-size: 18px;
    }

    .login-submit {
        min-height: 48px;
        font-size: 15px;
    }

    /* ── Check group / Check label ── */
    .check-group {
        max-height: 180px;
    }

    .check-label {
        font-size: 14px;
        min-height: 40px;
    }

    /* ── Badges ── */
    .badge {
        font-size: 11px;
    }

    .pill {
        font-size: 11px;
    }

    .platform-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* ─────────────────────────────────────────────
   Extra-small phones  (≤ 420px)
   ───────────────────────────────────────────── */
@media (max-width: 420px) {

    .container {
        padding: 8px 6px 24px;
    }

    .card {
        padding: 12px 10px;
        border-radius: 10px;
    }

    .page-title {
        font-size: 15px;
    }

    .sv-nav-select {
        font-size: 15px;
        padding: 9px 10px;
    }

    .sv-nav-user .pill {
        font-size: 11px;
        padding: 2px 6px;
    }

    /* Metric cards: 横並び2カラムに */
    .grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .grid.cols-3 > .card:first-child {
        grid-column: 1 / -1;
    }

    .metric-number {
        font-size: 22px;
    }

    /* Dashboard hero */
    .dashboard-hero-head {
        padding: 10px 10px 8px;
    }

    /* Filters */
    .df-row {
        padding: 8px 10px;
    }

    .df-group-dates {
        padding: 8px 10px;
    }

    .df-date-pair input[type="date"] {
        font-size: 13px;
        padding: 7px 6px;
    }

    /* Video table */
    .videos-table.v2 {
        min-width: 560px;
    }

    .vt-video {
        min-width: 170px;
    }

    .vt-title {
        -webkit-line-clamp: 1;
        font-size: 11px;
    }

    .vt-views {
        width: 80px;
    }

    .vt-tags {
        width: 100px;
    }

    .vt-actions {
        width: 48px;
    }

    /* Bulk tag form */
    .bulk-tag-form {
        padding: 8px;
    }

    .bulk-tag-form label {
        font-size: 12px;
    }

    /* Chart legend: 2-col */
    .chart-legend-toggles {
        gap: 3px 4px;
    }

    .chart-legend-toggles label {
        font-size: 10px;
        padding: 3px 6px;
    }

    /* Export menu full-width */
    .console-export-menu {
        width: calc(100vw - 24px);
        right: -6px;
    }

    /* Login */
    .login-card {
        padding: 24px 16px 20px;
    }

    .login-card .page-title {
        font-size: 17px;
    }
}

/* ─── Video Comparison Dashboard ─── */
.compare-header-card {
    background: linear-gradient(135deg, #eef3ff 0%, #f4f7fc 50%, #f0f0ff 100%);
    border: 1px solid #c7d4ed;
    padding: 20px 24px !important;
}
.compare-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.compare-header-top .page-title {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.compare-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: #2e6db4;
    color: #fff;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    padding: 0 8px;
}
.compare-video-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.compare-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 1px 4px rgba(30,41,59,0.08);
    transition: transform 0.15s, box-shadow 0.15s;
}
.compare-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(30,41,59,0.12);
}
.compare-chip-type {
    font-size: 10px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.compare-chip-title {
    color: #1e293b;
    font-weight: 500;
}
.compare-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    margin-left: 2px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.compare-chip-remove:hover {
    background: #ef4444;
    color: #fff;
}

/* ── Metric cards ── */
.compare-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.compare-metric-card {
    position: relative;
    padding: 20px 22px 18px !important;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.compare-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30,41,59,0.10);
}
.compare-mc-color-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}
.compare-mc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.compare-mc-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.compare-mc-date {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}
.compare-mc-views {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}
.compare-mc-number {
    font-size: 30px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -1px;
    line-height: 1.1;
}
.compare-mc-unit {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}
.compare-mc-bar-wrap {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    margin-bottom: 14px;
    overflow: hidden;
}
.compare-mc-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    min-width: 4px;
}
.compare-mc-sub-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}
.compare-mc-sub {
    display: flex;
    flex-direction: column;
    padding: 5px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.compare-mc-sub:hover {
    background: #f8fafc;
}
.compare-mc-sub-label {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}
.compare-mc-sub-val {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
}
.compare-mc-eng {
    font-size: 13px;
    font-weight: 700;
}
.compare-mc-eng.eng-high { color: #059669; }
.compare-mc-eng.eng-mid  { color: #d97706; }
.compare-mc-eng.eng-low  { color: #94a3b8; }

/* ── Chart section titles ── */
.compare-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
    font-size: 16px;
}
.compare-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
}
.compare-section-icon.icon-views { background: #eff6ff; color: #2563eb; }
.compare-section-icon.icon-eng   { background: #fef3c7; color: #d97706; }
.compare-section-icon.icon-bar   { background: #f0fdf4; color: #16a34a; }
.compare-section-icon.icon-table { background: #f5f3ff; color: #7c3aed; }

/* ── Chart tabs ── */
.compare-chart-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
}
.compare-metric-tab {
    font-size: 13px;
    padding: 7px 18px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.compare-metric-tab:hover {
    color: #1e293b;
    background: rgba(255,255,255,0.6);
}
.compare-metric-tab.active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-weight: 600;
}

/* ── Comparison table ── */
.compare-table {
    width: 100%;
}
.compare-table thead th {
    background: #f8fafc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
    padding: 10px 12px;
}
.compare-table tbody td {
    padding: 12px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}
.compare-table tbody tr:hover {
    background: #f8fafc;
}
.compare-table th.text-right,
.compare-table td.text-right {
    text-align: right;
}
.compare-table td.text-right {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #334155;
}
.compare-table-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.8), 0 0 0 3px currentColor;
}
.compare-table-title {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.compare-table-eng {
    font-weight: 700;
}
.compare-table-eng.eng-high { color: #059669; }
.compare-table-eng.eng-mid  { color: #d97706; }
.compare-table-eng.eng-low  { color: #64748b; }

.btn-sm {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
}

/* ── Two-column chart layout ── */
.compare-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 960px) {
    .compare-charts-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .compare-metrics-grid {
        grid-template-columns: 1fr;
    }
    .compare-header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .compare-chart-tabs {
        flex-wrap: wrap;
    }
    .compare-header-card {
        padding: 14px 16px !important;
    }
}

/* ─── Compare picker modal ─── */
.df-btn-group {
    display: flex;
    gap: 6px;
}
/* Multi-select video dropdown */
.ms-dropdown {
    position: relative;
    width: 100%;
}
.ms-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.ms-trigger:hover {
    border-color: #94a3b8;
}
.ms-dropdown.is-open .ms-trigger {
    border-color: #2e6db4;
    box-shadow: 0 0 0 3px rgba(46,109,180,0.12);
}
.ms-trigger-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ms-trigger-badge {
    flex-shrink: 0;
    background: #2e6db4;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 6px;
}
.ms-trigger-arrow {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.2s;
}
.ms-dropdown.is-open .ms-trigger-arrow {
    transform: rotate(180deg);
}
.ms-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 360px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15,23,42,0.18);
    z-index: 500;
    display: flex;
    flex-direction: column;
    max-height: 420px;
    overflow: hidden;
}
.ms-search {
    padding: 10px 12px 6px;
}
.ms-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.ms-search input:focus {
    border-color: #2e6db4;
    box-shadow: 0 0 0 3px rgba(46,109,180,0.10);
}
.ms-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    font-size: 12px;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
}
.ms-clear-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.ms-clear-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}
.ms-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    max-height: 260px;
}
.ms-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 13px;
}
.ms-item:hover {
    background: #f8fafc;
}
.ms-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #2e6db4;
    cursor: pointer;
}
.ms-item-title {
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.ms-footer {
    padding: 8px 12px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}
.ms-apply-btn {
    min-width: 140px;
    text-align: center;
    font-size: 13px;
    padding: 7px 16px;
}

/* ── Account Report ── */
.ar-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.ar-card {
    display: block;
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
    border-left: 4px solid var(--ar-accent, var(--brand));
}
.ar-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    pointer-events: none;
}
.ar-card-active .ar-card-check {
    border-color: var(--ar-accent, var(--brand));
    background: var(--ar-accent, var(--brand));
    box-shadow: inset 0 0 0 3px #fff;
}
.ar-card:hover {
    box-shadow: 0 4px 16px rgba(15,23,42,0.10);
    transform: translateY(-1px);
}
.ar-card-active {
    border-color: var(--ar-accent, var(--brand));
    border-left-width: 4px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ar-accent) 30%, transparent);
    background: color-mix(in srgb, var(--ar-accent) 6%, #fff);
}
.ar-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ar-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ar-card-number {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 6px;
}
.ar-card-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.ar-change {
    font-weight: 600;
    color: #64748b;
}
.ar-change-up {
    color: #16a34a;
}
.ar-change-down {
    color: #ef4444;
}
.ar-card-date {
    color: #94a3b8;
}
.ar-chart-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.ar-chart-wrap {
    position: relative;
    height: 360px;
    margin-top: 16px;
}
@media (max-width: 640px) {
    .ar-summary-grid {
        grid-template-columns: 1fr;
    }
    .ar-card-number {
        font-size: 24px;
    }
    .ar-chart-wrap {
        height: 260px;
    }
}

/* ── SNS Donut + ENG badges ── */
.sns-donut-wrap {
    position: relative;
    height: 200px;
    margin: 12px auto 16px;
    max-width: 240px;
}
.sns-pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px;
}
.sns-pie-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.sns-pie-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sns-pie-name {
    font-weight: 600;
    color: #334155;
    min-width: 72px;
}
.sns-pie-pct {
    font-weight: 700;
    color: #0f172a;
    min-width: 48px;
    text-align: right;
}
.sns-pie-val {
    color: #64748b;
    margin-left: auto;
}
.eng-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.eng-high {
    background: #dcfce7;
    color: #166534;
}
.eng-mid {
    background: #fef9c3;
    color: #854d0e;
}
.eng-low {
    background: #f1f5f9;
    color: #64748b;
}

/* ===== 動画比較ページ ===== */
.vc-controls { margin-bottom: 12px; position: relative; z-index: 50; }
.vc-controls-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ドロップダウン複数選択 */
.vc-select-wrap { position: relative; }
.vc-select-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
	border: 1px solid var(--line); border-radius: 6px; background: #fff;
	cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap;
	transition: border-color .12s;
}
.vc-select-btn:hover { border-color: #94a3b8; }
.vc-dropdown {
	position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
	width: 480px; max-width: 90vw; background: #fff; border: 1px solid var(--line);
	border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.vc-dropdown-search { padding: 8px; border-bottom: 1px solid var(--line); }
.vc-dropdown-search .input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.vc-dropdown-list { max-height: 300px; overflow-y: auto; padding: 4px 0; }
.vc-dropdown-item {
	display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer;
	font-size: 13px; transition: background .1s;
}
.vc-dropdown-item:hover { background: #f1f5f9; }
.vc-dropdown-item input[type="checkbox"] { flex-shrink: 0; accent-color: var(--brand, #1d4ed8); }
.vc-dd-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.vc-dd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vc-dd-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.vc-dd-meta { font-size: 11px; color: var(--muted); }
.vc-dropdown-footer {
	display: flex; align-items: center; gap: 8px; padding: 8px 12px;
	border-top: 1px solid var(--line); background: #f8fafc;
	border-radius: 0 0 8px 8px;
}
.vc-dd-count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* 期間プリセット */
.vc-period-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.vc-period-btn {
	padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px;
	background: #fff; cursor: pointer; font-size: 12px; font-weight: 500; transition: all .12s;
}
.vc-period-btn:hover { border-color: #94a3b8; }
.vc-period-btn.active { background: var(--ink, #0f172a); color: #fff; border-color: var(--ink, #0f172a); }
.vc-period-custom { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.vc-date-input { width: 120px; font-size: 12px; padding: 4px 6px; }

/* 指標タブ */
.vc-metric-tabs {
	display: flex; gap: 0; margin-bottom: 16px; overflow-x: auto;
	-webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--line);
}
.vc-tab {
	padding: 10px 16px; border: none; border-bottom: 2px solid transparent;
	background: none; cursor: pointer; font-size: 13px; font-weight: 500;
	color: var(--muted); white-space: nowrap; transition: all .12s;
}
.vc-tab:hover { color: var(--ink, #0f172a); }
.vc-tab.active { color: var(--brand, #1d4ed8); border-bottom-color: var(--brand, #1d4ed8); }

/* ローディング */
.vc-loading { display: flex; align-items: center; gap: 10px; padding: 32px; color: var(--muted); font-size: 13px; justify-content: center; }
.vc-spinner {
	width: 18px; height: 18px; border: 2px solid #e2e8f0; border-top-color: var(--brand, #1d4ed8);
	border-radius: 50%; animation: vc-spin .6s linear infinite;
}
@keyframes vc-spin { to { transform: rotate(360deg); } }

/* チャート */
.vc-chart-card { margin-bottom: 16px; }
.vc-chart-wrap { position: relative; height: 400px; }

/* KPIグリッド（概要・デバイス共用） */
.vc-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.vc-kpi-card { padding: 16px; }
.vc-kpi-header {
	font-size: 13px; font-weight: 600; margin-bottom: 14px;
	display: flex; align-items: center; gap: 8px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vc-kpi-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.vc-kpi-grid-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vc-kpi-cell { text-align: center; }
.vc-kpi-value { font-size: 17px; font-weight: 700; color: var(--ink, #0f172a); }
.vc-kpi-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
/* JS generates .vc-kpi-grid as container, cells use .vc-kpi-cell */
.vc-kpi-card .vc-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 0; }

/* テーブルラップ */
.table-wrap { overflow-x: auto; }
.table td.ok { color: var(--ok-ink); }
.table td.err { color: var(--err-ink); }

/* 選択中チップ */
.vc-selected-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; min-height: 28px; }
.vc-chip {
	display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
	background: #f0f4ff; border: 1px solid #c7d6f5; border-radius: 16px;
	font-size: 12px; font-weight: 500; color: var(--ink);
}
.vc-chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.vc-chip-x {
	background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1;
	color: #94a3b8; padding: 0 0 0 2px; transition: color .1s;
}
.vc-chip-x:hover { color: #ef4444; }

/* テーブル最良値ハイライト */
.vc-best { font-weight: 700; color: var(--brand, #1d4ed8); }
.vc-no-data { color: #94a3b8; font-size: 12px; font-style: italic; }
.vc-metric-label { font-weight: 500; color: var(--muted); white-space: nowrap; }
.vc-th-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* 空状態 */
.vc-empty { text-align: center; padding: 48px 16px; }
.vc-empty .muted { font-size: 14px; }

/* ベンチマーク管理 */
.vc-benchmark-admin { margin-top: 24px; font-size: 13px; }
.vc-benchmark-admin summary { cursor: pointer; font-weight: 500; color: var(--muted); }
.vc-label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }

@media (max-width: 640px) {
	.vc-controls-row { flex-direction: column; align-items: stretch; }
	.vc-dropdown { width: 100%; }
	.vc-period-bar { flex-wrap: wrap; }
	.vc-period-custom { margin-left: 0; }
	.vc-chart-wrap { height: 280px; }
	.vc-kpi-grid { grid-template-columns: 1fr; }
	.vc-kpi-card .vc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
	.vc-metric-tabs { gap: 0; }
	.vc-tab { padding: 8px 10px; font-size: 12px; }
}
