:root {
    --surface: rgba(15, 23, 42, 0.85);
    --surface-soft: rgba(15, 23, 42, 0.6);
    --border: rgba(148, 163, 184, 0.3);
    --text: #e2e8f0;
    --text-muted: #cbd5f5;
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --bg-color: #0b1220;

    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.modal-open {
    overflow: hidden;
}

#footer-container {
    margin-top: auto;
    width: 100%;
}
.amazon-associate {
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.5);
    margin: 0;
    text-align: right;
    line-height: 1.3;
}
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 1.5rem;
    box-sizing: border-box;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.ext {
    font-weight: 600;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    background: var(--surface);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 26px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.55);
}

/* Header (shared look) */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--surface-soft);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.header__logo p {
    margin: 0;
    white-space: nowrap;
}

.site-title-link {
    color: inherit;
    text-decoration: none;
}

.site-title-link:hover {
    opacity: 0.85;
}

.home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s;
    padding: 4px;
    border-radius: 6px;
}

.home-link:hover {
    color: var(--accent);
    background: rgba(148, 163, 184, 0.12);
}

.header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.header__actions .amazon-associate {
    margin: 0;
    text-align: right;
}

.setting-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
    flex: 0 0 auto;
}

.setting-share:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(56, 189, 248, 0.35);
    color: var(--text);
    transform: translateY(-2px);
}

.setting-share:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.65);
    outline-offset: 3px;
}

.brand h1 {
    margin: 0 0 6px 0;
    letter-spacing: 0.2px;
    font-size: 1.6rem;
    line-height: 1.25;
}

.tagline {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95em;
}

.tagline-sub {
    margin: 8px 0 0 0;
    color: var(--text-muted);
    font-size: 0.9em;
}

.hero {
    margin: 14px 0 16px 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.7);
}

.hero__image {
    display: block;
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
}

h1 { margin: 0 0 10px 0; }
h2 { margin: 0; }

.hidden { display: none !important; }

/* Guide */
.guide,
.edidsample {
    margin: 0 0 22px 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.guide h2,
.edidsample h2 {
    margin-bottom: 10px;
}

.edidsample p {
    margin: 0 0 10px 0;
    color: var(--text);
}

.steps {
    margin: 0 0 14px 18px;
    padding: 0;
}

.steps li {
    margin: 8px 0;
}

.steps.steps--compact {
    margin-left: 18px;
}

.steps.steps--compact li {
    margin: 6px 0;
    color: var(--text);
}

.callouts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.callout {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 14px;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.callout-body {
    color: var(--text);
}

.dip-guide {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.dip-figure {
    margin: 0;
}

.dip-image {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.dip-caption {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9em;
    line-height: 1.5;
}

.dip-notes {
    display: grid;
    gap: 8px;
}

.dip-note {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.setup-figure {
    margin: 12px 0 0 0;
}

.setup-image {
    display: block;
    width: 100%;
    max-width: 760px;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.setup-caption {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9em;
    line-height: 1.5;
}

.notice-box {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 14px;
    display: grid;
    gap: 8px;
}

.notice-box--danger {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.08);
}

.notice-box--warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.07);
}

.notice-title {
    font-weight: 800;
    letter-spacing: 0.2px;
}

.notice-text {
    color: var(--text);
}

.notice-kv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px dashed rgba(148, 163, 184, 0.25);
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.25);
}

.kv:first-child {
    border-top: none;
}

.k {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: var(--text-muted);
}

.v {
    font-weight: 600;
}

.bullets {
    margin: 0;
    padding-left: 18px;
}

.bullets li {
    margin: 6px 0;
    color: var(--text-muted);
}

/* File Inputs */
.file-input-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="file"] {
    display: none;
}

label.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-strong);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

label.button:hover {
    background-color: var(--accent);
}

/* EDID List */
.edid-list {
    margin-top: 20px;
    display: grid;
    gap: 15px;
}

.edid-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
}

.edid-info {
    flex: 1;
    min-width: 200px;
}

.edid-name {
    font-weight: bold;
    font-size: 1.1em;
    display: block;
}

.edid-addr {
    font-size: 0.85em;
    color: var(--text-muted);
    font-family: monospace;
}

.edid-mode {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.85em;
    color: var(--text-muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.85em;
    font-weight: 600;
}

.edid-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.edid-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.toggle-details-btn {
    margin-top: 10px;
    padding: 6px 10px;
    font-size: 0.85em;
}

.edid-details {
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.detail-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.22);
}

.detail-row:first-child {
    border-top: none;
}

.detail-label {
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
}

.detail-value {
    color: var(--text);
    word-break: break-word;
}

@media (max-width: 560px) {
    .detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.status-badge {
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-badge.modified {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.45);
}

button {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.35);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-button {
    background-color: rgba(34, 197, 94, 0.22);
    border: 1px solid rgba(34, 197, 94, 0.55);
    color: white;
    padding: 10px 20px;
    font-size: 1em;
}

.primary-button:hover {
    background-color: rgba(34, 197, 94, 0.3);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.controls-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Drag and Drop Highlight */
button.dragover {
    background-color: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* Modal (Flash status) */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
    overflow: hidden;
}

.modal-content {
    width: min(900px, 100%);
    height: min(720px, calc(100vh - 40px));
    max-height: calc(100vh - 40px);
    background: var(--surface);
    border-radius: 10px;
    box-shadow: 0 20px 45px -20px rgba(0,0,0,0.7);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.modal-title {
    font-weight: 700;
    font-size: 1.05em;
}

.modal-subtitle {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-close {
    padding: 8px 14px;
    border-radius: 6px;
}

.modal-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar-fill {
    height: 100%;
    background: var(--success-color);
    width: 0%;
}

.progress-text {
    width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.details-divider {
    border: 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.28);
    margin: 10px 0;
}

.detail-row--muted {
    color: var(--text-muted);
}

.edid-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.85em;
    white-space: nowrap;
}

.list-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.modal-log {
    margin: 0;
    padding: 14px 18px;
    height: auto;
    min-height: 0;
    flex: 1;
    overflow: auto;
    background: #0b1020;
    color: #d7e1ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.45;
    white-space: pre-wrap;
}

