
  :root { --bg:#1b1f25; --panel:#242931; --card:#2c323b; --line:#363d48; --text:#e9ecf1; --muted:#9aa3b0; --accent:#f28a3a; --good:#3fbf7f; --warn:#ec7a35; }
  * { box-sizing:border-box; }
  html,body { margin:0; height:100%; background:var(--bg); color:var(--text); font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
  button { font:inherit; color:inherit; }
  .muted { color:var(--muted); }
  .app { display:grid; grid-template-columns:minmax(0,1fr) 400px; height:calc(100vh - 54px); height:calc(100dvh - 54px); }
  .left { position:relative; display:flex; flex-direction:column; min-width:0; min-height:0; }
  .top { display:flex; align-items:center; gap:12px; padding:14px 18px 0; flex-wrap:wrap; }
  .top h1 { font-size:17px; margin:0; font-weight:600; }
  #stagetitle { color:var(--muted); font-size:13px; }
  .seg { display:inline-flex; background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:3px; margin-left:auto; }
  .seg button { background:none; border:0; padding:6px 13px; border-radius:999px; cursor:pointer; font-size:13px; }
  .seg button[aria-pressed="true"] { background:var(--text); color:var(--bg); font-weight:600; }
  #stage { flex:1; position:relative; min-height:0; touch-action:none; }
  #stage canvas { position:absolute; inset:0; width:100%; height:100%; display:block; cursor:grab; }
  .views { position:absolute; z-index:2; left:50%; bottom:14px; transform:translateX(-50%); display:flex; gap:4px; background:rgba(36,41,49,.92); border:1px solid var(--line); border-radius:999px; padding:4px; }
  .views button { background:none; border:0; padding:7px 13px; border-radius:999px; cursor:pointer; font-size:13px; }
  .views button:hover { background:#333a45; }
  .views button[aria-pressed="true"] { background:var(--accent); color:#1b1f25; font-weight:600; }
  #legend { position:absolute; z-index:2; right:16px; top:10px; font-size:12px; color:var(--muted); text-align:right; }
  .lt { margin-bottom:4px; }
  .grad { width:150px; height:8px; border-radius:4px; background:linear-gradient(90deg,#f7d774,#f28a3a,#d9333b); margin-left:auto; }
  .gl { display:flex; justify-content:space-between; width:150px; margin:2px 0 0 auto; }
  .keys { display:flex; flex-direction:column; gap:3px; align-items:flex-end; }
  .keys i.ug { width:60px; height:8px; border-radius:4px; background:linear-gradient(90deg,#d9453d,#ec7a35,#f2c14e); }
  .keys span { display:flex; align-items:center; gap:6px; } .keys i { width:10px; height:10px; border-radius:2px; display:inline-block; }
  #card { position:absolute; z-index:3; left:14px; top:10px; width:min(310px, calc(100% - 28px)); background:rgba(44,50,59,.97); border:1px solid var(--line); border-radius:12px; padding:12px 14px; box-shadow:0 10px 30px rgba(0,0,0,.35); }
  #card .x { position:absolute; right:6px; top:4px; background:none; border:0; font-size:20px; color:var(--muted); cursor:pointer; padding:4px 8px; }
  .ch { display:flex; align-items:center; gap:8px; font-size:15px; } .sw { width:12px; height:12px; border-radius:3px; }
  .cv { font-size:24px; font-weight:650; margin-top:4px; } .cv small { font-size:12px; font-weight:400; color:var(--muted); }
  .ct { font-size:12px; color:var(--muted); margin-bottom:4px; }
  #card ul { list-style:none; margin:8px 0 0; padding:0; } #card li { display:flex; justify-content:space-between; gap:8px; padding:5px 0; border-top:1px solid var(--line); font-size:13px; }
  .r { white-space:nowrap; color:var(--muted); font-size:12px; } .r.primary { color:var(--accent); }
  .sugg { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
  .chip { background:#363e4a; border:1px solid #444c59; border-radius:999px; padding:4px 10px; font-size:12px; cursor:pointer; }
  .chip:hover { border-color:var(--accent); }
  aside { background:var(--panel); border-left:1px solid var(--line); display:flex; flex-direction:column; min-width:0; min-height:0; }
  .tabs { display:flex; border-bottom:1px solid var(--line); padding:0 10px; }
  .tabs button { background:none; border:0; padding:13px 12px 11px; cursor:pointer; color:var(--muted); border-bottom:2px solid transparent; font-weight:550; display:flex; align-items:center; gap:6px; }
  .tabs button[aria-selected="true"] { color:var(--text); border-bottom-color:var(--accent); }
  .badge { font-size:11px; padding:1px 7px; border-radius:999px; } .badge.warn { background:var(--warn); color:#1b1f25; } .badge.good { background:var(--good); color:#1b1f25; }
  .pane { overflow:auto; padding:14px 16px 24px; flex:1; }
  h2 { font-size:11px; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin:16px 0 8px; font-weight:650; }
  h2:first-child { margin-top:0; }
  #days { display:flex; flex-wrap:wrap; gap:6px; }
  .day { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:6px 10px; cursor:pointer; font-size:13px; }
  .day small { color:var(--muted); margin-left:4px; } .day.on { border-color:var(--accent); background:#3a332c; }
  .day.add { color:var(--muted); border-style:dashed; }
  .dayedit { display:flex; gap:6px; margin-top:10px; }
  .dayedit input { flex:1; min-width:0; }
  input, select { background:#1f242b; border:1px solid var(--line); color:var(--text); border-radius:8px; padding:7px 9px; font:inherit; }
  input:focus, select:focus { outline:2px solid var(--accent); outline-offset:-1px; }
  .btn { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:6px 10px; cursor:pointer; font-size:13px; white-space:nowrap; }
  a.btn { color:var(--text); text-decoration:none; display:inline-block; }
  .btn:hover { border-color:#58606d; } .btn:disabled { opacity:.4; cursor:default; }
  #confirm { margin-top:8px; background:#3b2a2a; border:1px solid #6b3a3a; border-radius:8px; padding:8px 10px; font-size:13px; }
  #confirm button { margin-left:6px; } .danger { background:#c8463f; border:0; border-radius:6px; padding:4px 10px; color:#fff; cursor:pointer; }
  #confirm #cn { background:none; border:1px solid var(--line); border-radius:6px; padding:3px 9px; cursor:pointer; }
  .item { display:grid; grid-template-columns:1fr auto auto; gap:8px; align-items:center; background:var(--card); border-radius:10px; padding:9px 10px; margin-bottom:6px; }
  .iname b { font-weight:550; font-size:13.5px; }
  .tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
  .tag { font-size:11px; padding:1px 6px; border-radius:4px; background:#38404b; color:var(--muted); } .tag.p { background:#4a3a2c; color:#ffc49a; }
  .step { display:flex; align-items:center; background:#1f242b; border-radius:8px; }
  .step button { background:none; border:0; width:30px; height:30px; cursor:pointer; font-size:16px; } .step span { min-width:20px; text-align:center; font-weight:600; font-variant-numeric:tabular-nums; }
  .rm { background:none; border:0; color:var(--muted); font-size:18px; cursor:pointer; padding:4px 6px; } .rm:hover { color:#ff7b72; }
  .empty { padding:8px 0; }
  .search { display:flex; gap:6px; } .search input { flex:1; min-width:0; } .search select { width:130px; }
  #results { margin-top:6px; border:1px solid var(--line); border-radius:10px; max-height:340px; overflow:auto; }
  .res { display:block; width:100%; text-align:left; background:none; border:0; border-bottom:1px solid var(--line); padding:8px 10px; cursor:pointer; }
  .res:hover { background:#2f363f; } .res b { font-weight:550; } .res em { font-style:normal; font-size:11px; color:var(--accent); }
  .res.create { color:var(--accent); border-bottom:0; }
  .mrow { display:grid; grid-template-columns:118px 1fr 52px 36px; align-items:center; gap:8px; width:100%; background:none; border:0; padding:5px 6px; border-radius:6px; cursor:pointer; text-align:left; font-size:13px; }
  .mode-day .mrow { grid-template-columns:118px 1fr 34px; }
  .mrow:hover { background:#2c323b; } .mrow.on { background:#363d48; }
  .bar { position:relative; height:7px; background:#1b1f25; border-radius:4px; overflow:hidden; }
  .bar .band { position:absolute; top:0; bottom:0; background:rgba(63,191,127,.22); } .bar .fill { position:absolute; left:0; top:0; bottom:0; border-radius:4px; }
  .mv { text-align:right; font-variant-numeric:tabular-nums; } .mv small { color:var(--muted); }
  .st { font-size:11px; text-align:center; border-radius:4px; padding:1px 0; } .st.under { color:var(--warn); } .st.none { color:#ff8a80; } .st.ok { color:var(--good); } .st.over { color:#b99bff; }
  .need { background:var(--card); border-radius:10px; padding:9px 10px; margin-bottom:6px; }
  .okmsg { color:var(--good); }
  .trow { display:grid; grid-template-columns:1fr 64px auto 64px; gap:8px; align-items:center; padding:4px 0; }
  .trow input { width:64px; padding:5px 7px; }
  .sync { font-size:12px; color:var(--muted); } .sync.ok { color:var(--good); } .sync.warn { color:var(--warn); }
  .foot { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:18px; }
  .note { font-size:12px; color:var(--muted); margin-top:14px; }
  #toast { position:fixed; left:50%; bottom:24px; transform:translate(-50%,20px); background:#e9ecf1; color:#1b1f25; padding:8px 14px; border-radius:999px; font-size:13px; font-weight:550; opacity:0; transition:.2s; pointer-events:none; z-index:20; }
  #toast.show { opacity:1; transform:translate(-50%,0); }
  #custom { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:30; display:flex; align-items:center; justify-content:center; padding:16px; }
  #custom[hidden] { display:none; }
  .dlg { background:var(--panel); border:1px solid var(--line); border-radius:14px; width:min(440px,100%); max-height:90vh; display:flex; flex-direction:column; }
  .dlg header { padding:14px 16px 0; } .dlg h3 { margin:0 0 10px; font-size:16px; }
  .dlg .body { padding:0 16px; overflow:auto; }
  #cmus { display:grid; grid-template-columns:1fr 1fr; gap:6px 12px; margin-top:12px; }
  .cm { display:flex; justify-content:space-between; align-items:center; gap:6px; font-size:13px; } .cm select { padding:4px 6px; }
  .dlg footer { padding:12px 16px; display:flex; justify-content:flex-end; gap:8px; align-items:center; }
  #cerr { color:#ff8a80; font-size:12px; margin-right:auto; }
  .primary-btn { background:var(--accent); color:#1b1f25; border:0; border-radius:8px; padding:7px 14px; font-weight:650; cursor:pointer; }
  @media (max-width: 860px) {
    .app { grid-template-columns:minmax(0,1fr); height:auto; }
    .left { height:68vh; min-height:440px; }
    aside { border-left:0; border-top:1px solid var(--line); }
    .pane { overflow:visible; }
    #legend { top:6px; right:10px; }
    .grad, .gl { width:120px; }
    #card { top:8px; }
  }

  /* ---- Site chrome ---- */
  .nav { height:54px; display:flex; align-items:center; gap:18px; padding:0 18px; border-bottom:1px solid var(--line); background:#191d23; position:sticky; top:0; z-index:40; }
  .brand { display:flex; align-items:center; gap:8px; font-weight:700; color:var(--text); text-decoration:none; font-size:16px; letter-spacing:-.01em; }
  .brand img { width:26px; height:26px; border-radius:7px; }
  .nav nav { display:flex; gap:4px; }
  .nav nav a { color:var(--muted); text-decoration:none; padding:7px 11px; border-radius:8px; font-size:14px; font-weight:550; }
  .nav nav a:hover { color:var(--text); background:#262b33; } .nav nav a[aria-current="page"] { color:var(--text); background:#2c323b; }
  .nav .btn[data-install] { margin-left:auto; border-color:var(--accent); color:var(--accent); }
  .loaderr, #loading { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:var(--muted); margin:0; }
  /* ---- Content pages ---- */
  .page { max-width:980px; margin:0 auto; padding:28px 20px 60px; }
  .hero { display:grid; grid-template-columns:1.1fr .9fr; gap:28px; align-items:center; padding:20px 0 10px; }
  .hero h1 { font-size:clamp(28px,4.4vw,44px); line-height:1.08; margin:0 0 14px; letter-spacing:-.02em; }
  .hero p { color:var(--muted); font-size:16px; margin:0 0 20px; max-width:46ch; }
  .heroimg { display:flex; justify-content:center; border-radius:16px; }
  .heroimg img { max-height:520px; max-width:100%; width:auto; height:auto; display:block; }
  .cta { display:flex; gap:10px; flex-wrap:wrap; }
  .bigbtn { display:inline-block; text-decoration:none; background:var(--accent); color:#1b1f25; font-weight:700; padding:11px 18px; border-radius:10px; border:0; cursor:pointer; font-size:15px; }
  .bigbtn.ghost { background:none; color:var(--text); border:1px solid var(--line); font-weight:600; }
  .grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:28px; }
  .tile { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px; }
  .tile b { display:block; font-size:26px; letter-spacing:-.01em; } .tile span { color:var(--muted); font-size:13px; }
  .feat { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:28px; }
  .feat div { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px; }
  .feat h3 { margin:0 0 6px; font-size:15px; } .feat p { margin:0; color:var(--muted); font-size:13.5px; }
  .section-h { font-size:12px; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin:32px 0 10px; font-weight:650; }
  .lowlist { display:flex; flex-wrap:wrap; gap:6px; } .pill { background:#3a2a22; color:#ffb48a; border-radius:999px; padding:4px 10px; font-size:13px; }
  .pill.ok { background:#1f3a2c; color:#8fe0b5; }
  .toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:6px 0 18px; }
  .daycard { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:12px; break-inside:avoid; }
  .daycard h3 { margin:0 0 8px; font-size:16px; display:flex; justify-content:space-between; } .daycard h3 small { color:var(--muted); font-weight:400; font-size:13px; }
  table { width:100%; border-collapse:collapse; font-size:14px; }
  th, td { text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); } th { color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.05em; }
  td.n, th.n { text-align:right; font-variant-numeric:tabular-nums; }
  .s-under { color:#ff9a6a; } .s-none { color:#ff8a80; } .s-ok { color:#7fdcab; } .s-over { color:#c3a6ff; }
  .msg { font-size:13px; margin-left:4px; }
  footer.site { color:var(--muted); font-size:12px; text-align:center; padding:24px 16px 32px; }
  footer.site a { color:var(--muted); }
  @media (max-width: 760px) {
    .hero { grid-template-columns:1fr; } .heroimg img { max-height:360px; } .grid3, .feat { grid-template-columns:1fr; }
    .nav { gap:8px; padding:0 10px; } .nav nav a { padding:6px 8px; } .brand span { display:none; }
  }
  @media print {
    .nav, .toolbar, footer.site { display:none !important; }
    body { background:#fff; color:#000; } .daycard { background:#fff; border-color:#bbb; } th, td { border-color:#ccc; color:#000; }
    .page { padding:0; } .muted, th { color:#444; }
  }
