/* -------- Theme -------- */
:root{
    --bg: #F6F7F8;           /* Light Grayish White */
    --ink: #4A4A4A;          /* Dark Gray */
    --muted: #A1A1A1;        /* Medium Gray */
    --indigo: #5C6BC0;       /* Soft Indigo */
    --sage: #A1C4B2;         /* Sage Green */
    --peach: #F2C2D1;        /* Pale Peach */
    --radius: 14px;
    --pad: 14px;
    --ring: 2px;
    --shadow: 0 2px 20px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body{
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--ink);
    background: radial-gradient(1200px 800px at 10% -10%, rgba(92,107,192,0.06), transparent 60%),
    radial-gradient(1200px 800px at 90% -10%, rgba(161,196,178,0.10), transparent 60%),
    var(--bg);
}

.site-header{
    max-width: 980px;
    margin: 32px auto 8px;
    padding: 0 16px;
}
h1{
    margin: 0 0 6px 0;
    letter-spacing: 0.2px;
}
.subtitle{
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Container panels */
.panel{
    display: none;
    max-width: 980px;
    margin: 12px auto 40px;
    padding: 18px;
    background: rgba(255,255,255,0.7);
    border: 1px solid #eaeaea;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: saturate(1.1) blur(2px);
}
.panel.is-active{ display: block; }

/* Tabs */
.tabs{
    max-width: 980px;
    margin: 8px auto 10px;
    padding: 0 8px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e7e8ea;
}
.tab{
    appearance: none;
    border: none;
    background: transparent;
    color: var(--ink);
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    position: relative;
    font-weight: 600;
}
.tab.is-active{
    color: var(--indigo);
}
.tab.is-active::after{
    content: "";
    position: absolute;
    left: 10px; right: 10px; bottom: -1px;
    height: 3px;
    background: linear-gradient(90deg, var(--indigo), var(--sage));
    border-radius: 2px;
}
.tab:focus-visible{
    outline: none;
    box-shadow: 0 0 0 var(--ring) rgba(92,107,192,0.35);
    border-radius: 12px;
}

/* Form bits */
.grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}
.field{ display: grid; gap: 6px; }
.label{ font-size: 0.85rem; color: var(--muted); }

input, select{
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e3e6;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus{
    outline: none;
    border-color: var(--indigo);
    box-shadow: 0 0 0 var(--ring) rgba(92,107,192,0.25);
}

/* Buttons */
.controls{ display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.btn{
    appearance: none;
    border: 1px solid #e2e3e6;
    background: #fff;
    color: var(--ink);
    padding: 9px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .03s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover{ box-shadow: var(--shadow); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{
    opacity: .7;
    cursor: not-allowed;
    background: #e9e9ee;
    color: #444;
    border-color: #d6d7db;
}

.btn-primary{
    background: var(--indigo);
    color: #fff;
    border-color: transparent;
}
.btn-primary:hover{ box-shadow: 0 6px 24px rgba(92,107,192,0.28); }

.btn-accent{
    background: linear-gradient(135deg, var(--sage), var(--indigo));
    color: #fff;
    border-color: transparent;
}
.btn-accent:hover{ box-shadow: 0 6px 24px rgba(161,196,178,0.35); }

/* Content */
.stack{ margin: 16px 0; }
.h{ margin: 0 0 6px 0; font-size: 1rem; color: var(--muted); }

.log{
    white-space: pre-wrap;
    background: #fff;
    border: 1px dashed #e0e1e4;
    border-radius: 12px;
    padding: var(--pad);
    min-height: 2.8rem;
}

/* State-highlights (success/err/info tones) */
.log.success{ background: linear-gradient(0deg, rgba(161,196,178,0.18), rgba(161,196,178,0.12)); }
.log.warn{ background: linear-gradient(0deg, rgba(242,194,209,0.22), rgba(242,194,209,0.12)); }

/* Audio */
.audio{ width: 100%; margin-top: 8px; }

.media-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.media-grid img, .media-grid video{
    width: 100%;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e6ea;
}

/* File upload styling */
.file-upload {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: inline-block;
    padding: 9px 14px;
    background: #fff;
    border: 1px solid #e2e3e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.9rem;
    color: var(--ink);
}

.file-upload-label:hover {
    box-shadow: var(--shadow);
    border-color: var(--indigo);
}

.file-upload-label:active {
    transform: translateY(1px);
}

.file-upload-text {
    pointer-events: none;
}

.file-list {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    max-height: 100px;
    overflow-y: auto;
}

.file-list-item {
    padding: 2px 0;
    word-break: break-all;
}

/* Small hint */
.hint{ color: var(--muted); font-size: .9rem; }

/* Code */
code{ background: #fff; padding: 2px 6px; border-radius: 6px; border: 1px solid #eee; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
    .btn, .tab{ transition: none; }
}
