:root {
  --bg: #0d1017; --panel: #161b26; --panel2: #1d2434; --line: #2a3247;
  --text: #e8ecf4; --muted: #93a0b8; --accent: #e8b33c; --accent2: #4cc2ff;
  --ok: #3ecf6f; --bad: #ff5d5d; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
header#topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 17px; }
header nav { display: flex; gap: 14px; }
header nav a { color: var(--text); opacity: .85; }
header nav a:hover { opacity: 1; text-decoration: none; color: var(--accent); }
.userbox { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
main { max-width: 1060px; margin: 0 auto; padding: 18px 14px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; }
textarea { min-height: 130px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
button { background: var(--accent); color: #191204; border: 0; border-radius: 8px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
button.small { padding: 5px 10px; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.ready, .badge.released { color: var(--ok); border-color: var(--ok); }
.badge.preparing { color: var(--accent); border-color: var(--accent); }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.board .col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.board .col h3 { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.rel { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; }
.rel .t { font-weight: 600; }
.rel .s { font-size: 12px; color: var(--muted); }
.gate { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.gate input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ok); flex: none; }
.gate .done-label { text-decoration: line-through; color: var(--muted); }
.gate .when { margin-left: auto; font-size: 12px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 2px 4px; }
.cal-head.fri { color: var(--accent); }
.cal-day { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px; min-height: 84px; font-size: 12px; overflow: hidden; }
.cal-day.week { min-height: 150px; }
.cal-day.outside { opacity: .38; }
.cal-day.fri { border-color: var(--accent); background: #1a1c14; }
.cal-day .dnum { color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.cal-day .frilabel { color: var(--accent); font-size: 10px; }
.chip { display: block; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 2px 6px; margin-bottom: 4px; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { border-color: var(--accent2); text-decoration: none; }
.chip.ready, .chip.released { border-color: var(--ok); }
.chip.preparing { border-color: var(--accent); }
.packet { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 13px;
  max-height: 480px; overflow: auto; }
@media (max-width: 640px) {
  .cal-grid, .cal-week { grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .cal-day { min-height: 56px; padding: 3px; }
  .cal-day.week { min-height: 90px; }
}
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--accent); color: var(--text);
  padding: 10px 18px; border-radius: 8px; z-index: 50; max-width: 90vw; }
.error { color: var(--bad); font-size: 14px; min-height: 20px; }
.progress { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: var(--ok); }
@media (max-width: 640px) {
  table th:nth-child(4), table td:nth-child(4) { display: none; }
  header#topbar { gap: 10px; }
}
