/* ============================================================
   KRT PROMPY — Pastel Studio v4.0 (Web Edition)
   Mobile-responsive pastel redesign of PVM Gemini Image Cleaner
   ============================================================ */

:root {
  --bg: #faf7f2;
  --bg-soft: #f3eef7;
  --card: #ffffff;
  --ink: #3d3a50;
  --ink-soft: #7a7590;
  --line: #e9e3f3;

  --lav: #8f7ad8;
  --lav-soft: #ede9fe;
  --lav-deep: #6d5bc0;
  --mint: #34b78c;
  --mint-soft: #e0f7ee;
  --peach: #f2916e;
  --peach-soft: #fdeee6;
  --rose: #e86a8a;
  --rose-soft: #fdeaef;
  --gold: #d9a441;
  --gold-soft: #fdf3dd;

  --grad-primary: linear-gradient(135deg, #9d8ae8 0%, #7c6ad9 55%, #6a8fe0 100%);
  --grad-ai: linear-gradient(135deg, #f2a1c0 0%, #b490ea 50%, #8ec5f0 100%);
  --shadow-card: 0 4px 18px rgba(109, 91, 192, 0.08);
  --shadow-pop: 0 10px 30px rgba(109, 91, 192, 0.16);
  --radius: 16px;
  --radius-sm: 10px;

  --sidebar-w: 264px;
  --font: 'Noto Sans Thai', 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 110% -10%, #efe7fb 0%, transparent 55%),
    radial-gradient(900px 420px at -10% 110%, #e2f5ec 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
kbd {
  background: #fff; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 0 6px; font-size: 12px; font-family: inherit;
}
code { background: var(--lav-soft); border-radius: 6px; padding: 1px 6px; font-size: 13px; }

/* ---------------- layout ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; }
.sb-logo-wrap img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow-card); }
.sb-brand-info h1 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .4px; }
.sb-brand-info span { font-size: 10px; color: var(--ink-soft); letter-spacing: 1.2px; font-weight: 600; }
.sb-close { display: none; margin-left: auto; background: none; border: none; font-size: 18px; color: var(--ink-soft); cursor: pointer; }

.sb-status-card {
  margin: 4px 14px 10px; padding: 8px 12px;
  background: var(--mint-soft); border: 1px solid #cdeee0;
  border-radius: 12px; font-size: 12px; font-weight: 600; color: #1d7a5c;
  display: flex; align-items: center; gap: 8px;
}
.sb-status-card.no-key { background: var(--gold-soft); border-color: #f0e0b8; color: #8a6a1f; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(52,183,140,.18); flex: 0 0 auto; }
.sb-status-card.no-key .status-dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(217,164,65,.2); }

.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-group-title {
  font-size: 10px; letter-spacing: 1.4px; color: var(--ink-soft);
  font-weight: 700; padding: 12px 8px 6px;
}
.nav-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 0;
  border: none; border-radius: 12px; background: transparent;
  font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink);
  cursor: pointer; text-align: left;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.nav-btn .nav-ico { width: 22px; text-align: center; font-size: 15px; }
.nav-btn:hover { background: var(--lav-soft); }
.nav-btn:active { transform: scale(.98); }
.nav-btn.active {
  background: var(--grad-primary); color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(124, 106, 217, .35);
}
.sb-footer {
  padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10.5px; color: var(--ink-soft);
}
.sb-ver-pill { background: var(--lav-soft); color: var(--lav-deep); border-radius: 999px; padding: 2px 9px; font-weight: 700; }

.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(40,32,70,.4); z-index: 39; opacity: 0; transition: opacity .18s ease; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-head {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  background: rgba(250, 247, 242, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hamburger { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; padding: 6px 11px; cursor: pointer; color: var(--ink); }
.head-title-wrap { flex: 1; min-width: 0; }
.head-title-wrap h2 { margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-title-wrap p { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-actions .badge { white-space: nowrap; }

.main-body { padding: 22px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------------- views & cards ---------------- */
.view-section { display: none; animation: viewIn .18s ease both; }
.view-section.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  margin-bottom: 18px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fdfcff, #faf8fe);
}
.card-title { font-weight: 700; font-size: 14.5px; flex: 1; }
.card-title .hint { font-weight: 400; }
.card-body { padding: 16px 18px; }
.step-card .card-head { background: linear-gradient(180deg, #f6f2fe, #faf8fe); }
.step-no {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  background: var(--grad-primary); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(124,106,217,.4);
}
.result-card { border-color: #d9cff2; }

.hint { font-size: 12px; color: var(--ink-soft); margin: 6px 0; }

/* ---------------- form fields ---------------- */
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 10px 0; }
.field-area, .field-input, .field-select {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fffdfd; color: var(--ink);
  font-family: inherit; font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field-area { resize: vertical; min-height: 60px; line-height: 1.6; }
.field-area:focus, .field-input:focus, .field-select:focus {
  outline: none; border-color: var(--lav);
  box-shadow: 0 0 0 3px rgba(143, 122, 216, .15);
}
.field-label .field-input, .field-label .field-select, .field-label .field-area { margin-top: 5px; font-weight: 400; }
.inline-label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 8px 0; }
.inline-label .field-select, .inline-label .field-input { font-weight: 400; }
.inline-label.grow { flex: 1; min-width: 200px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row-wrap .inline-label { margin: 8px 0; min-width: 160px; }
.row-wrap .inline-label.grow { flex: 1; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border: none; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; color: var(--ink);
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease, opacity .15s;
  background: var(--lav-soft);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: 0 4px 14px rgba(124,106,217,.35); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(124,106,217,.45); }
.btn-ai { background: var(--grad-ai); color: #fff; box-shadow: 0 4px 14px rgba(190,140,220,.35); }
.btn-ghost { background: #fff; border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--lav); color: var(--lav-deep); }
.btn-danger { background: var(--rose-soft); color: var(--rose); }
.btn-danger:hover { background: var(--rose); color: #fff; }
.btn-mini { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; background: #fff; border: 1.5px solid var(--line); }
.btn-mini:hover { border-color: var(--lav); color: var(--lav-deep); }
.btn-mini.danger { color: var(--rose); }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------------- badges & chips ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: var(--lav-soft); color: var(--lav-deep);
}
.badge-mint { background: var(--mint-soft); color: #1d7a5c; }
.badge-peach { background: var(--peach-soft); color: #c05f3c; }
.badge-rose { background: var(--rose-soft); color: var(--rose); }
.badge-gold { background: var(--gold-soft); color: #8a6a1f; }

.chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.chip {
  background: var(--lav-soft); color: var(--lav-deep);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600;
  border: none; cursor: pointer; font-family: inherit;
  transition: transform .1s ease, box-shadow .15s;
}
.chip:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(124,106,217,.2); }
.chip-mint .chip { background: var(--mint-soft); color: #1d7a5c; }
.chip-peach .chip { background: var(--peach-soft); color: #c05f3c; }

/* ---------------- output boxes ---------------- */
.out-box { position: relative; margin: 10px 0; }
.out-box pre {
  background: #fbfaff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 96px 14px 14px; margin: 0;
  font-family: inherit; font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow-y: auto;
}
.out-box.tall pre { max-height: 520px; }
.out-box .copy-btn { position: absolute; top: 8px; right: 8px; }
.pre-wrap {
  background: #fbfaff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 6px 0; font-family: inherit; font-size: 13px;
  white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow-y: auto;
}
.sub-block { margin-top: 14px; }
.sub-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.note-box {
  margin-top: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--gold-soft); border: 1px solid #f0e0b8;
  font-size: 13px; color: #6f571f; white-space: pre-wrap;
}
.status-line {
  margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--lav-soft); font-size: 13px; font-weight: 600; color: var(--lav-deep);
  white-space: pre-wrap;
}
.status-line.error { background: var(--rose-soft); color: var(--rose); }
.status-line.ok { background: var(--mint-soft); color: #1d7a5c; }
.status-line.busy::after { content: ' …'; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------------- tabs ---------------- */
.tabset { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.tab-btn {
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; transition: all .15s ease;
}
.tab-btn:hover { border-color: var(--lav); color: var(--lav-deep); }
.tab-btn.active { background: var(--grad-primary); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(124,106,217,.3); }
.tab-btn.small { padding: 5px 11px; font-size: 12px; }
.lang-toggle { display: flex; gap: 6px; margin: 4px 0 10px; }

/* ---------------- home ---------------- */
.hero-card {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(120deg, #ffffff 0%, #f4efff 60%, #eafaf3 100%);
  border: 1px solid #e4dbf7; border-radius: 22px;
  padding: 26px 28px; margin-bottom: 18px; box-shadow: var(--shadow-card);
}
.hero-text { flex: 1; min-width: 0; }
.hero-text h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.grad-text { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-text p { margin: 0 0 14px; color: var(--ink-soft); font-size: 13.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-art { flex: 0 0 auto; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-grid.slim { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 10px 0; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-card);
}
.stat-ico { font-size: 22px; }
.stat-info { display: flex; flex-direction: column; min-width: 0; }
.stat-info b { font-size: 13.5px; }
.stat-info span { font-size: 11.5px; color: var(--ink-soft); }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.quick-btn {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; font-family: inherit; text-align: left;
  transition: all .15s ease;
}
.quick-btn:hover { border-color: var(--lav); transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.quick-btn .q-ico { font-size: 19px; }
.quick-btn .q-name { font-weight: 700; font-size: 13px; }
.quick-btn .q-desc { font-size: 11px; color: var(--ink-soft); line-height: 1.4; }

/* ---------------- dropzone & previews ---------------- */
.dropzone {
  border: 2px dashed #d7cdf0; border-radius: var(--radius);
  background: #fbfaff; padding: 26px 16px; text-align: center;
  color: var(--ink-soft); font-size: 13.5px; cursor: pointer;
  transition: all .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--lav); background: var(--lav-soft); color: var(--lav-deep); }
.dropzone.small { padding: 18px 10px; font-size: 12.5px; }
.dz-ico { font-size: 26px; margin-bottom: 6px; }
.preview-wrap { margin-top: 12px; position: relative; display: inline-block; max-width: 100%; }
.preview-wrap img { max-width: 340px; max-height: 300px; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }
.preview-wrap.small img { max-width: 100%; max-height: 200px; }
.preview-wrap .btn-mini { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); }

.thumb-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb {
  position: relative; width: 118px; border: 1.5px solid var(--line);
  border-radius: 12px; overflow: hidden; background: #fff;
  animation: viewIn .16s ease both;
}
.thumb img { width: 100%; height: 84px; object-fit: cover; display: block; }
.thumb .thumb-meta { padding: 6px 7px; display: flex; flex-direction: column; gap: 4px; }
.thumb .thumb-name { font-size: 10px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb select { width: 100%; font-size: 10.5px; padding: 3px 4px; border-radius: 7px; border: 1px solid var(--line); font-family: inherit; background: #fff; }
.thumb .thumb-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: rgba(232,106,138,.92); color: #fff;
  font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0; }
.compare-grid figure { margin: 0; }
.compare-grid figcaption { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; text-align: center; }
.compare-grid img { width: 100%; max-height: 380px; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }

/* ---------------- styles matrix / ideas ---------------- */
.style-results { display: flex; flex-direction: column; gap: 12px; }
.style-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; animation: viewIn .18s ease both; }
.style-card .sc-head { display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.style-card .sc-rank { font-weight: 800; font-size: 14px; }
.style-card .sc-name { font-weight: 700; font-size: 13.5px; flex: 1; }
.style-card pre {
  margin: 0; padding: 12px 15px; font-family: inherit; font-size: 12.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto; background: #fbfaff;
}

.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.idea-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 14px 16px; animation: viewIn .18s ease both; }
.idea-card h4 { margin: 0 0 6px; font-size: 14px; }
.idea-card .idea-summary { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 8px; }
.idea-card details { margin-top: 6px; }
.idea-card summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--lav-deep); }
.idea-card pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 12px; background: #fbfaff; border: 1px solid var(--line); border-radius: 8px; padding: 9px; margin: 7px 0; max-height: 220px; overflow-y: auto; }

/* ---------------- score & gates ---------------- */
.score-row { display: flex; gap: 18px; align-items: center; margin: 8px 0 4px; }
.score-dial {
  width: 92px; height: 92px; flex: 0 0 92px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: var(--lav-deep);
  background: conic-gradient(var(--lav) calc(var(--pct, 0) * 1%), #eee6fa 0);
  position: relative;
}
.score-dial::before { content: ''; position: absolute; inset: 8px; background: #fff; border-radius: 50%; }
.score-dial span { position: relative; z-index: 1; }
.score-dial.good { color: #1d7a5c; background: conic-gradient(var(--mint) calc(var(--pct,0) * 1%), #dff3ea 0); }
.score-dial.bad { color: var(--rose); background: conic-gradient(var(--rose) calc(var(--pct,0) * 1%), #fbdfe6 0); }
.score-meta { flex: 1; min-width: 0; }
.score-rating { font-weight: 700; margin-bottom: 6px; }

.bar-list { display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.bar-row .bar-label { flex: 0 0 150px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-track { flex: 1; height: 8px; border-radius: 999px; background: #efe9fa; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 999px; background: var(--grad-primary); transition: width .3s ease; }
.bar-row .bar-val { flex: 0 0 34px; text-align: right; font-weight: 700; }

.issue-list { display: flex; flex-direction: column; gap: 7px; }
.issue {
  padding: 9px 13px; border-radius: 10px; font-size: 13px;
  background: var(--rose-soft); color: #a34257; border: 1px solid #f5d3dc;
}
.issue.ok { background: var(--mint-soft); color: #1d7a5c; border-color: #cdeee0; }
.issue.info { background: var(--lav-soft); color: var(--lav-deep); border-color: #ddd2f5; }

.gate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; }
.gate {
  border-radius: 12px; padding: 9px 12px; font-size: 12px;
  border: 1px solid #cdeee0; background: var(--mint-soft);
}
.gate.flagged { border-color: #f0e0b8; background: var(--gold-soft); }
.gate b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-bottom: 3px; }
.gate .g-reason { color: var(--ink-soft); }
.gate .g-sugg { margin-top: 4px; color: #8a6a1f; font-weight: 600; }

/* ---------------- logs ---------------- */
.log-list { display: flex; flex-direction: column; gap: 9px; }
.log-item {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start;
  animation: viewIn .15s ease both;
}
.log-item .log-main { flex: 1; min-width: 0; }
.log-item .log-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.log-item .log-title { font-weight: 700; font-size: 13.5px; }
.log-item .log-time { font-size: 11px; color: var(--ink-soft); }
.log-item .log-io { font-size: 12px; color: var(--ink-soft); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-list.compact .log-item .log-io { display: none; }
.log-empty { text-align: center; color: var(--ink-soft); padding: 22px; font-size: 13px; }

/* ---------------- settings ---------------- */
.security-note {
  background: var(--mint-soft); border: 1px solid #cdeee0; border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; color: #1d5c47; margin-bottom: 12px;
}
.key-row { display: flex; gap: 8px; margin-top: 5px; align-items: stretch; }
.key-row .field-input { flex: 1; }
.about-text { font-size: 13px; color: var(--ink-soft); margin: 0; }

/* ---------------- toasts & modal ---------------- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(92vw, 380px); }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--lav);
  border-radius: 12px; padding: 11px 15px; font-size: 13px; box-shadow: var(--shadow-pop);
  animation: toastIn .18s ease both;
}
.toast.ok { border-left-color: var(--mint); }
.toast.error { border-left-color: var(--rose); }
.toast.warn { border-left-color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(40,32,70,.45);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fadeIn .15s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-pop);
  width: min(440px, 100%); overflow: hidden; animation: viewIn .18s ease both;
}
.modal-head { padding: 16px 20px 6px; font-weight: 800; font-size: 16px; }
.modal-body { padding: 6px 20px 14px; font-size: 13.5px; color: var(--ink-soft); white-space: pre-wrap; }
.modal-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 9px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1020px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: none; width: min(300px, 86vw); flex-basis: min(300px, 86vw);
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  body.nav-open .sb-backdrop { display: block; opacity: 1; }
  .sb-close { display: block; }
  .hamburger { display: inline-flex; }
  .main-body { padding: 14px; }
  .main-head { padding: 11px 14px; }
  .head-title-wrap h2 { font-size: 16px; }
  .head-title-wrap p { display: none; }
  .hero-card { flex-direction: column; text-align: center; padding: 22px 18px; }
  .hero-actions { justify-content: center; }
  .hero-art { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .score-row { flex-direction: column; align-items: flex-start; }
  .out-box pre { padding-right: 14px; }
  .out-box .copy-btn { position: static; margin-top: 8px; }
  .toast-wrap { right: 10px; left: 10px; bottom: 10px; max-width: none; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .action-row .btn { flex: 1 1 100%; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* shake for errors (ui_spec) */
@keyframes shakeX { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.shake { animation: shakeX .22s ease 2; }
