:root {
  --paper: #f2efe7;
  --paper-2: #e9e5da;
  --card: #fbfaf6;
  --ink: #141413;
  --ink-2: #4a4843;
  --ink-3: #8a867c;
  --line: #d9d4c7;
  --lime: #d6ff3d;
  --lime-ink: #2b3300;
  --night: #121311;
  --night-2: #1c1d1a;
  --night-line: #2e2f2a;
  --red: #d8462f;
  --amber: #c98a12;
  --green: #2f8f4e;
  --radius: 14px;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.serif { font-family: var(--serif); font-weight: 400; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); font-weight: 500; text-decoration: none;
  cursor: pointer; transition: transform .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.lime { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-2); background: var(--card);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(47,143,78,.18); }
.dot.warn { background: var(--amber); }
.dot.off { background: var(--red); }

/* ---------- landing ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; font-size: 17px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; }
.logo-mark svg { width: 16px; height: 16px; }
.nav-links { display: flex; gap: 26px; align-items: center; font-size: 14px; color: var(--ink-2); }
.nav-links a { text-decoration: none; }

.hero { padding: 72px 0 40px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 8.4vw, 112px);
  line-height: .92; letter-spacing: -.025em; margin: 18px 0 22px; max-width: 12ch;
}
.hero h1 em { font-style: italic; }
.hero h1 .hl { background: var(--lime); padding: 0 .12em; border-radius: 6px; }
.hero p.lead { font-size: 19px; color: var(--ink-2); max-width: 56ch; margin: 0 0 30px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.console {
  margin-top: 56px; background: var(--night); color: #e9e8e2; border-radius: 20px; padding: 22px;
  border: 1px solid var(--night-line); box-shadow: 0 30px 80px -40px rgba(0,0,0,.5);
}
.console-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: #9b9a92; }
.console-input {
  display: flex; gap: 10px; align-items: center; background: var(--night-2); border: 1px solid var(--night-line);
  border-radius: 12px; padding: 14px 16px; font-size: 17px;
}
.console-input .caret { width: 2px; height: 20px; background: var(--lime); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.console-steps { margin-top: 16px; display: grid; gap: 8px; }
.console-step {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px;
  border-radius: 10px; background: rgba(255,255,255,.03); font-size: 14px;
}
.console-step .n { font-family: var(--mono); font-size: 11px; color: #77766e; }
.console-step .s { font-family: var(--mono); font-size: 11px; color: var(--lime); }

.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 64px); line-height: 1; letter-spacing: -.02em; margin: 14px 0 18px; }
.section .sub { color: var(--ink-2); max-width: 60ch; font-size: 17px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 44px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 14px 0 6px; font-size: 17px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.card .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; }
.card .ic svg { width: 18px; height: 18px; }

.steps { counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 44px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps > div { padding: 28px; background: var(--card); border-right: 1px solid var(--line); }
.steps > div:last-child { border-right: 0; }
.steps .big { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--ink-3); }
.steps h3 { margin: 16px 0 6px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 14px; }

.safety { background: var(--night); color: #e9e8e2; border-radius: 24px; padding: 48px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; }
.safety h2 { color: #fff; }
.safety .sub { color: #a9a8a0; }
.limits { display: grid; gap: 10px; }
.limit { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid var(--night-line); border-radius: 12px; }
.limit b { font-family: var(--mono); font-weight: 500; color: var(--lime); }

.price { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; }
.price .card { padding: 32px; }
.price .amt { font-family: var(--serif); font-size: 64px; line-height: 1; margin: 18px 0 6px; }
.price ul { padding: 0; margin: 22px 0 26px; list-style: none; display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.price li::before { content: "→ "; color: var(--ink); }
.price .card.dark { background: var(--night); color: #e9e8e2; border-color: var(--night); }
.price .card.dark ul { color: #b5b4ac; }
.price .card.dark li::before { color: var(--lime); }

.foot { padding: 40px 0 60px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .grid3, .grid4, .steps, .price, .safety { grid-template-columns: 1fr; }
  .steps > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .safety { padding: 28px; }
  .nav-links a:not(.btn) { display: none; }
  .section { padding: 64px 0; }
  .wrap { padding: 0 16px; }
}

/* ---------- app ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--night); color: #d9d8d0; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { color: #fff; padding: 4px 8px 22px; }
.side .logo-mark { background: var(--lime); }
.side .logo-mark svg path { stroke: var(--night); }
.navi { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 14px; color: #b8b7ae; border: 0; background: none; text-align: left; width: 100%; }
.navi:hover { background: rgba(255,255,255,.05); color: #fff; }
.navi.active { background: rgba(214,255,61,.1); color: var(--lime); }
.navi svg { width: 16px; height: 16px; flex: none; }
.navi .count { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--night-line); color: #ddd; padding: 1px 7px; border-radius: 99px; }
.side-foot { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--night-line); font-size: 12px; color: #8b8a82; display: grid; gap: 8px; }

.main { padding: 28px 36px 80px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar h1 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; margin: 0; letter-spacing: -.02em; }
.view { display: none; }
.view.active { display: block; }

.command {
  background: var(--night); border-radius: 20px; padding: 18px; color: #eee;
}
.command textarea {
  width: 100%; min-height: 76px; resize: vertical; background: transparent; border: 0; outline: none;
  color: #fff; font-size: 18px; line-height: 1.45; padding: 6px 8px;
}
.command textarea::placeholder { color: #6f6e66; }
.command-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--night-line); }
.command-bar .mono { color: #7f7e76; }

.chips-head { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 12px; gap: 10px; flex-wrap: wrap; }
.chips-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.chip {
  position: relative; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; transition: border-color .15s, transform .15s; min-height: 92px; display: flex; flex-direction: column; gap: 6px;
}
.chip:hover { border-color: var(--ink); transform: translateY(-1px); }
.chip .k { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.chip .t { font-size: 14px; line-height: 1.35; }
.chip.custom { background: #fffef4; border-style: dashed; }
.chip .x { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.chip .x:hover { background: var(--paper-2); color: var(--ink); }

.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin-top: 26px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.meter { display: grid; grid-template-columns: 92px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.meter .bar { height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.meter .bar i.hot { background: var(--red); }
.meter .v { font-family: var(--mono); font-size: 11px; color: var(--ink-2); text-align: right; }

.task { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.task:last-child { border-bottom: 0; }
.task .meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); grid-column: 1 / -1; }
.task .prog { grid-column: 1 / -1; height: 4px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.task .prog i { display: block; height: 100%; background: var(--lime); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.task.running .meta { color: var(--green); }

.log { font-family: var(--mono); font-size: 12px; display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.log div { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.log time { color: var(--ink-3); }
.log .err { color: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td .h { color: var(--ink-2); font-size: 13px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pill { display: inline-block; font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); margin: 0 4px 4px 0; }
.pill.y { background: var(--lime); color: var(--lime-ink); }

.review { display: grid; gap: 12px; }
.ritem { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.ritem .ctx { font-size: 13px; color: var(--ink-2); background: var(--paper); border-radius: 10px; padding: 10px 12px; max-height: 120px; overflow: auto; }
.ritem textarea { width: 100%; min-height: 84px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; resize: vertical; }
.ritem .row { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }

.form { display: grid; gap: 18px; max-width: 760px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .help { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.field input[type=text], .field input[type=number], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 0; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; border-radius: 14px; background: #fff3d6; border: 1px solid #ecd59a; margin-bottom: 20px; font-size: 14px; }
.banner.ok { background: #e7f5ea; border-color: #b9dfc3; }

.modal-bg { position: fixed; inset: 0; background: rgba(15,15,13,.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: var(--card); border-radius: 18px; padding: 24px; width: min(560px, 100%); display: grid; gap: 14px; }
.modal h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.mobile-nav { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 18px 16px 90px; }
  .cols { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 34px; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--night); padding: 8px; gap: 4px; overflow-x: auto; z-index: 40; }
  .mobile-nav .navi { flex: none; width: auto; font-size: 12px; padding: 8px 10px; }
}
