:root{
  --bg: #f6f7fb;
  --card: rgba(255,255,255,0.92);
  --text: #101828;
  --muted: #667085;
  --border: rgba(16, 24, 40, 0.12);
  --shadow: 0 12px 30px rgba(16,24,40,0.10);

  --primary: #2563eb;
  --primary2:#1d4ed8;
  --danger: #e11d48;

  --pillBg: rgba(16,24,40,0.04);

  --fieldBg: rgba(16,24,40,0.03);
  --chipBg: rgba(16,24,40,0.04);
  --chipBorder: rgba(16,24,40,0.10);

  --dangerBg: rgba(225,29,72,0.08);
  --dangerBorder: rgba(225,29,72,0.22);

  --headerBg: rgba(246,247,251,0.75);
}

html[data-theme="dark"]{
  --bg:#0b0c10;
  --card: rgba(18,20,27,0.92);
  --text:#e9ecf1;
  --muted:#a5adbb;
  --border:rgba(255,255,255,0.10);
  --shadow: 0 12px 30px rgba(0,0,0,0.25);

  --primary:#4f8cff;
  --primary2:#3b73d9;
  --danger:#ff5a5f;

  --pillBg: rgba(0,0,0,0.18);

  --fieldBg: rgba(0,0,0,0.25);
  --chipBg: rgba(255,255,255,0.06);
  --chipBorder: rgba(255,255,255,0.12);

  --dangerBg: rgba(255,90,95,0.12);
  --dangerBorder: rgba(255,90,95,0.28);

  --headerBg: rgba(11,12,16,0.72);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1000px 700px at 30% 10%, rgba(37,99,235,.12), transparent 60%),
    radial-gradient(900px 600px at 80% 30%, rgba(225,29,72,.08), transparent 60%),
    var(--bg);
  background-attachment: fixed; 
  color:var(--text);
}

html[data-theme="dark"] body{
  background:
    radial-gradient(1000px 700px at 30% 10%, rgba(79,140,255,.18), transparent 60%),
    radial-gradient(900px 600px at 80% 30%, rgba(255,90,95,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

.container{max-width:980px;margin:0 auto;padding:0 16px 40px}

.headerWrap{
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0 10px;
  background: var(--headerBg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header{
  display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;
  max-width:980px;margin:0 auto;padding:0 16px;
}

.header h1{margin:0 0 6px;font-size:22px}
.subtext{margin:0;color:var(--muted);font-size:13px}
.topActions{display:flex; gap:10px; align-items:center; margin-top:2px;}

.themeToggle{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 8px;border:1px solid var(--border);
  border-radius:999px;background: var(--pillBg);user-select:none;
}

.iconBtn{
  width:34px;height:30px;border-radius:999px;border:1px solid transparent;
  background: transparent;color: var(--muted);cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  font-size:16px;line-height:1;
}

.iconBtn[aria-pressed="true"]{
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.25);
  color: var(--text);
}

html[data-theme="dark"] .iconBtn[aria-pressed="true"]{
  background: rgba(79,140,255,0.18);
  border-color: rgba(79,140,255,0.28);
}

.divider{width:1px;height:16px;background: var(--border);opacity:0.9;}

.statusline{
  margin-top:8px;font-size:12px;color:var(--muted);
  display:flex;gap:10px;flex-wrap:wrap;align-items:center;
}

.pill{
  border:1px solid var(--border);padding:4px 8px;border-radius:999px;
  background: var(--pillBg);
}

.pill.ok{border-color:rgba(34,197,94,0.35); color:rgba(21,128,61,0.95)}
.pill.warn{border-color:rgba(245,158,11,0.35); color:rgba(180,83,9,0.95)}
.pill.bad{border-color:rgba(225,29,72,0.35); color:rgba(190,18,60,0.95)}
html[data-theme="dark"] .pill.ok{border-color:rgba(100,211,138,0.35); color:rgba(100,211,138,0.95)}
html[data-theme="dark"] .pill.warn{border-color:rgba(255,211,106,0.35); color:rgba(255,211,106,0.95)}
html[data-theme="dark"] .pill.bad{border-color:rgba(255,90,95,0.35); color:rgba(255,90,95,0.95)}

.card{
  margin-top:16px;border:1px solid var(--border);background: var(--card);
  border-radius:16px;padding:16px;box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.card[aria-disabled="true"]{opacity:.60}
.card-header h2{margin:0 0 4px;font-size:18px}
.hint{margin:0 0 12px;color:var(--muted);font-size:13px}
.label{display:block;font-size:13px;color:var(--muted);margin:10px 0 6px}

textarea, input[type="text"], input[type="url"], select{
  width:100%;
  border:1px solid var(--border);
  background: var(--fieldBg);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  outline:none;
}

textarea{resize:vertical}
textarea:focus, input:focus, select:focus{border-color: rgba(37,99,235,0.55);}
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus{border-color: rgba(79,140,255,0.6);}

input[type="file"]{
  width:100%;
  padding:10px;border-radius:12px;
  border:1px dashed rgba(16,24,40,0.25);
  background: rgba(16,24,40,0.02);
  color: var(--muted);
}

html[data-theme="dark"] input[type="file"]{
  border:1px dashed rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
}

.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;}
.chip{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--chipBorder);
  background: var(--chipBg);
  font-size:12px;color: var(--text);
  user-select:none;
}
.chip input{accent-color: var(--primary);}

.actions{display:flex;gap:10px;flex-wrap:wrap}
button{
  border:0;border-radius:12px;padding:10px 14px;
  font-weight:800;cursor:pointer;
}

.primary{background:var(--primary);color:#ffffff}
.primary:hover{background:var(--primary2)}

.secondary{
  background: rgba(16,24,40,0.04);
  color: var(--text);
  border:1px solid var(--border);
}
html[data-theme="dark"] .secondary{background: rgba(255,255,255,0.08);color: var(--text);}

.ghost{background:transparent;color:var(--text);border:1px solid var(--border);padding:8px 12px;}

.dangerBtn{
  background: var(--dangerBg);
  border: 1px solid var(--dangerBorder);
  color: var(--text);
  padding: 8px 12px;
}

button:disabled{opacity:.45;cursor:not-allowed}

.toast{margin:10px 0 0;min-height:18px;color:var(--muted);font-size:13px}
.footer{margin-top:18px;color:var(--muted);text-align:center}
.footer a{color: inherit; text-decoration: underline;}
.footer a:hover{opacity:0.85}

.fileList{margin-top:12px;display:flex;flex-direction:column;gap:10px;}
.fileRow{border:1px solid var(--border);border-radius:14px;padding:12px;background: rgba(16,24,40,0.02);}
html[data-theme="dark"] .fileRow{background: rgba(0,0,0,0.18)}

.fileRowTop{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;}
.fileLeft{flex:1 1 420px; min-width:280px;}
.fileNameLine{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.fileName{font-weight:900}
.tag{font-size:12px;padding:4px 8px;border-radius:999px;border:1px solid var(--border);background: var(--pillBg);color: var(--muted);}
.fileMeta{color:var(--muted);font-size:12px;margin-top:4px}
.fileRight{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

.thumb{width:64px;height:64px;border-radius:12px;overflow:hidden;border:1px solid var(--border);background: rgba(255,255,255,0.4);flex:0 0 auto;}
html[data-theme="dark"] .thumb{background: rgba(255,255,255,0.06)}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
@media (max-width:820px){ .grid2{grid-template-columns:1fr;} }

.tinyHint{margin:8px 0 0;color:var(--muted);font-size:12px}
.contentStart{padding-top:16px;}

.segmented{
  display:inline-flex;
  border:1px solid var(--border);
  background: var(--pillBg);
  border-radius:999px;
  padding:4px;
  gap:4px;
  flex-wrap:wrap;
}

.segBtn{
  border:1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}

.segBtn[aria-pressed="true"]{
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.25);
  color: var(--text);
}

html[data-theme="dark"] .segBtn[aria-pressed="true"]{
  background: rgba(79,140,255,0.18);
  border-color: rgba(79,140,255,0.28);
}



