:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1e293b;
  --ink-soft: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  padding-bottom: 60px;
}

.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 20px;
  padding: 0 28px; height: 58px; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.topnav { display: flex; gap: 4px; }
.topnav a { text-decoration: none; color: var(--ink-soft); font-weight: 600; padding: 8px 14px; border-radius: 8px; }
.topnav a.active, .topnav a:hover { color: var(--accent); background: var(--accent-soft); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.userbox .email { color: var(--ink-soft); font-weight: 600; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #0ea5e9; color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.logout { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 28px 28px 40px; }
h1 { font-size: 21px; margin-bottom: 4px; }
.sub { color: var(--ink-soft); margin-bottom: 22px; }
.backlink { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 13px; }

.section-h { display: flex; align-items: center; margin: 8px 0 12px; gap: 8px; }
.section-h h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.chip { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative;
  transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; gap: 10px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.10); }
.card h3 { font-size: 15px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card p { color: var(--ink-soft); font-size: 13px; line-height: 1.45; flex: 1; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
  background: var(--bg); border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px;
}
.card .icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; }
.ic-blue { background: var(--accent-soft); color: var(--accent); }
.ic-green { background: var(--green-soft); color: var(--green); }
.ic-amber { background: var(--amber-soft); color: var(--amber); }
.ic-violet { background: #f5f3ff; color: #7c3aed; }
.star { position: absolute; top: 14px; right: 14px; background: none; border: 0; color: #cbd5e1; cursor: pointer; padding: 4px; }
.star.on { color: #f59e0b; }
.star svg { width: 18px; height: 18px; fill: currentColor; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.panel h2 { font-size: 15px; margin-bottom: 14px; }

.btn {
  display: inline-block; border: 0; border-radius: 9px; font-weight: 700; font-size: 13.5px;
  padding: 10px 18px; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.opt { margin-bottom: 16px; }
.opt label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 7px; }
.opt .req { color: var(--red); }
.opt input[type=text], .opt input[type=email], .opt input[type=password], .opt select, .opt textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13.5px; background: #fff; color: var(--ink); outline: none; font-family: inherit;
}
.opt input:focus, .opt select:focus, .opt textarea:focus { border-color: var(--accent); }
.opt input[type=file] { font-size: 13px; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 5px; }
.runbar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.errorbox { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; font-weight: 600; margin-bottom: 16px; font-size: 13px; }
.okbox { background: var(--green-soft); color: var(--green); border: 1px solid #a7f3d0; border-radius: 8px; padding: 10px 14px; font-weight: 600; margin-bottom: 16px; font-size: 13px; }

.progress-wrap { padding: 34px 26px; }
.bar { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #60a5fa); border-radius: 999px; transition: width .6s; }
.prog-meta { display: flex; justify-content: space-between; margin: 10px 2px 20px; font-size: 13px; color: var(--ink-soft); }
.log {
  background: #0f172a; color: #94a3b8; border-radius: 10px; padding: 16px 18px;
  font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: 12.5px;
  line-height: 1.7; max-height: 300px; overflow-y: auto;
}

.outputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.outfile { display: flex; align-items: center; gap: 14px; padding: 18px; }
.outfile .fico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.outfile svg { width: 22px; height: 22px; }
.outfile .nm { font-weight: 700; font-size: 14px; }
.outfile .ds { color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }
.outfile .btn { margin-left: auto; white-space: nowrap; }

table.hist { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.hist th {
  text-align: left; padding: 12px 14px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-soft); border-bottom: 1px solid var(--line);
}
table.hist td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.hist tr:hover td { background: #f8fafc; }
.status { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-completed { background: var(--green-soft); color: var(--green); }
.st-running, .st-queued { background: var(--amber-soft); color: var(--amber); }
.st-failed { background: var(--red-soft); color: var(--red); }
.rowacts a { color: var(--accent); font-weight: 600; text-decoration: none; margin-right: 12px; }
.filelist { color: var(--ink-soft); font-size: 12.5px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; }
.filters input, .filters select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
  background: #fff; color: var(--ink); outline: none;
}

.prov-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.prov-row.prov-active { background: var(--accent-soft); border-radius: 10px; padding: 14px; }
.prov-head { margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.prov-grid { display: grid; grid-template-columns: 180px 1fr 1fr 200px; gap: 8px; }
.prov-grid input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; background: #fff; color: var(--ink); outline: none;
}
.task-provider, .task-model {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; background: #fff; color: var(--ink); outline: none; width: 100%;
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; width: 280px;
}
.search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 13.5px; color: var(--ink); }

.login-card { max-width: 420px; margin: 8vh auto 0; padding: 36px 34px; }
.msbtn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.devnote { font-size: 12px; color: var(--ink-soft); text-align: center; margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.devform { display: flex; flex-direction: column; gap: 10px; }
.devform input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }

code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 12px; }

.dropzone {
  border: 2px dashed #b6c6e3; border-radius: var(--radius); background: #f8faff;
  padding: 36px 20px; text-align: center; color: var(--ink-soft); cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .big { font-size: 15px; font-weight: 700; color: var(--ink); margin: 10px 0 4px; }
.dropzone svg { width: 32px; height: 32px; color: var(--accent); }
.filechip {
  display: flex; align-items: center; gap: 10px; border: 1px solid #a7f3d0;
  background: var(--green-soft); border-radius: 10px; padding: 10px 14px; margin-top: 12px;
  font-weight: 600; font-size: 13px;
}
.scan-summary { font-size: 13.5px; margin-bottom: 14px; }
.scan-h { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 700; margin: 16px 0 8px; }
.scan-h.warn { color: var(--amber); }
.lang-card { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.lang-card input { accent-color: var(--accent); width: 16px; height: 16px; }
.col-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px 26px; }
.col-chip { font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); border: 1px solid #c7dbff; padding: 2px 9px; border-radius: 999px; }
.col-chip.dim { background: var(--bg); color: var(--ink-soft); border-color: var(--line); }
.col-chip.warnchip { background: var(--amber-soft); color: var(--amber); border-color: #fde68a; }
.warnline { color: var(--amber); font-size: 12.5px; font-weight: 600; margin: 6px 0 0 26px; }
.checkline { display: flex; gap: 9px; align-items: center; font-weight: 500 !important; font-size: 13.5px !important; cursor: pointer; }
.checkline input { accent-color: var(--accent); width: 16px; height: 16px; }
#scan-status { font-weight: 600; }

table.about-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.about-table th {
  text-align: left; padding: 8px 12px 8px 0; width: 180px;
  color: var(--ink-soft); font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; vertical-align: top;
}
table.about-table td { padding: 8px 0; font-weight: 600; }

@media (max-width: 900px) {
  .outputs { grid-template-columns: 1fr; }
  .userbox .email { display: none; }
}
