/* kdtools — plain, compact styling. No framework. */
:root {
  --bg: #f6f7f5;
  --card: #ffffff;
  --ink: #1c2420;
  --muted: #5c6a62;
  --line: #dde3de;
  --green: #1e7d46;
  --green-bg: #e5f4ea;
  --amber: #9a6a00;
  --amber-bg: #fdf3d7;
  --red: #b3261e;
  --red-bg: #fbe9e7;
  --accent: #14532d;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--accent); color: #fff;
}
.brand { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-weight: 400; font-size: 13px; opacity: .85; margin-left: 6px; }
.status { font-size: 13px; opacity: .95; text-align: right; }
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.dot.on { background: #7be495; } .dot.off { background: #ffb3ae; }

.tabs { display: flex; gap: 4px; padding: 10px 20px 0; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: #ecefec; color: var(--ink);
  padding: 7px 14px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 14px;
  border-bottom: none;
}
.tab.active { background: var(--card); font-weight: 600; }
main { padding: 0 20px 30px; }
.panel { display: none; }
.panel.active { display: block; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 0 10px 10px 10px;
  padding: 16px; display: flex; gap: 12px; align-items: end; margin-bottom: 16px;
}
.card.col { flex-direction: column; align-items: stretch; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld.grow { flex: 1; }
.fld span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fld.inline { flex-direction: row; align-items: center; gap: 8px; }
input[type="text"], input[type="number"], textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  font: inherit; background: #fff; width: 100%;
}
.small-input { width: 90px !important; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 14px;
  text-decoration: none; display: inline-block;
}
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn.danger { color: var(--red); border-color: #eec5c1; }
.btn:disabled { opacity: .55; cursor: wait; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.busy { color: var(--muted); padding: 10px 2px; }
.error { color: var(--red); background: var(--red-bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.hidden { display: none !important; }
.note { color: var(--muted); font-size: 13.5px; }
.foot { padding: 14px 20px 26px; color: var(--muted); font-size: 12.5px; }

.result-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.result-card h2 { margin: 0 0 6px; font-size: 18px; }
.result-card h3 { margin: 18px 0 8px; font-size: 15px; }
.verdict { border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.verdict .v-word { font-size: 17px; font-weight: 700; }
.verdict.worth { background: var(--green-bg); }
.verdict.skip { background: var(--red-bg); }
.verdict.risky { background: var(--amber-bg); }
.verdict ul { margin: 6px 0 0; padding-left: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chip { background: #eef1ee; border-radius: 999px; padding: 3px 11px; font-size: 13px; }
.chip b { font-weight: 700; }
.chip.filler { background: var(--accent); color: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
.tbl-wrap { overflow-x: auto; }
.tag { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #eef1ee; white-space: nowrap; }
.tag.forum { background: #e3e9fd; } .tag.qa { background: #e0f2f1; }
.tag.youtube { background: #fde3e3; } .tag.facebook { background: #e3ecfd; }
.tag.social { background: #f3e5f5; } .tag.article { background: #ecefec; }
.tag.giant { background: var(--red); color: #fff; }
.matrix td.cell-yes { background: var(--green-bg); text-align: center; font-weight: 700; }
.matrix td.cell-no { text-align: center; color: #b6beb8; }
ul.plain { margin: 6px 0; padding-left: 20px; }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.ideas-grid button {
  text-align: left; background: none; border: none; border-bottom: 1px dashed var(--line);
  padding: 6px 2px; cursor: pointer; font: inherit; color: var(--accent);
}
.ideas-grid button:hover { background: #f0f5f1; }
iframe.trends { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.delta-up { color: var(--red); font-weight: 700; }
.delta-down { color: var(--green); font-weight: 700; }
.kw-link { color: var(--accent); cursor: pointer; text-decoration: underline; }
@media (max-width: 720px) {
  .card { flex-direction: column; align-items: stretch; }
  iframe.trends { height: 340px; }
}
