:root {
  --graphite: #0C0F12;
  --bg: #0C0F12;
  --panel: #14181d;
  --line: #2a3036;
  --text: #F4F4F0;
  --muted: #8B9195;
  --steel: #8B9195;
  --lime: #C7F000;
  --cyan: #00E5FF;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, Segoe UI, sans-serif;
}
body.app-shell { padding-bottom: calc(64px + var(--safe-bottom)); }
a { color: var(--cyan); text-decoration: none; }
.hide { display: none !important; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: linear-gradient(var(--graphite), color-mix(in srgb, var(--graphite) 93%, transparent));
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--lime);
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 13px;
}
.bell {
  position: relative;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.bell .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
}
.wrap { padding: 16px; max-width: 560px; margin: 0 auto; }
h1 { font-size: 26px; margin: 0 0 12px; letter-spacing: -0.03em; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.card, .item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 0 0 10px;
}
.item { cursor: pointer; }
.kicker { color: var(--cyan); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: grid; gap: 8px; margin-bottom: 12px; }
input, textarea, select, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--graphite);
  color: var(--text);
  padding: 10px 12px;
  width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
button, .btn {
  background: var(--lime);
  color: var(--graphite);
  border: 0;
  font-weight: 700;
  cursor: pointer;
  width: auto;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
label { display: block; color: var(--muted); font-size: 12px; margin: 8px 0 4px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { width: auto; }
.pill {
  display: inline-block;
  background: #1a2208;
  color: var(--lime);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  margin-right: 4px;
}
.err { color: #ff6b6b; min-height: 1.2em; }
.ticket {
  font-family: ui-monospace, Consolas, monospace;
  background: var(--graphite);
  border: 1px dashed var(--lime);
  border-radius: 12px;
  padding: 12px;
  word-break: break-all;
  color: var(--lime);
}
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--graphite);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  z-index: 6;
}
.tabbar button {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 12px 2px 10px;
  font-size: 11px;
  width: auto;
}
.tabbar button.on { color: var(--lime); }
.login-hero {
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(12px, env(safe-area-inset-top))
    0
    max(20px, env(safe-area-inset-bottom));
  background: var(--graphite);
  display: flex;
  flex-direction: column;
}
.login-shell {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-art {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--graphite);
}
.login-art img {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  max-height: clamp(168px, 34dvh, 360px);
  object-fit: contain;
  object-position: center top;
}
.login-panel {
  flex: 1 1 auto;
  min-width: 0;
}
.login-panel-inner.wrap {
  padding-top: 0;
  max-width: 560px;
}
.login-panel-inner h1 {
  font-size: clamp(22px, 5vw, 28px);
}
@media (min-width: 640px) {
  .login-art img {
    max-height: clamp(220px, 38dvh, 420px);
  }
  .login-shell {
    gap: 16px;
    padding: 0 16px;
  }
}
@media (min-width: 900px) {
  .login-shell {
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 24px;
  }
  .login-art {
    flex: 1 1 55%;
    padding: 0;
  }
  .login-art img {
    width: 100%;
    max-width: none;
    max-height: min(72dvh, 520px);
  }
  .login-panel {
    flex: 1 1 45%;
  }
  .login-panel-inner.wrap {
    max-width: none;
    padding: 0;
  }
}
@media (min-width: 1200px) {
  .login-art img {
    max-height: min(68dvh, 560px);
  }
}
@media (max-height: 640px) and (orientation: landscape) {
  .login-shell {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
  }
  .login-art {
    flex: 0 0 48%;
  }
  .login-art img {
    max-height: 78dvh;
  }
  .login-panel {
    flex: 1 1 52%;
    overflow-y: auto;
  }
  .login-panel-inner h1 {
    font-size: 20px;
    margin-bottom: 8px;
  }
}
.brand-link { display: flex; align-items: center; min-width: 0; flex: 1; }
.brand-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: min(200px, 58vw);
  object-fit: contain;
  object-position: left center;
}
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-actions .bell { width: auto; padding: 0 10px; font-size: 12px; }
.code-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.code-chips button {
  width: auto;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #1b2228;
  color: var(--text);
  border: 1px solid var(--line);
}
.code-chips a {
  display: inline-block;
  width: auto;
  padding: 8px 10px;
  margin: 0 8px 8px 0;
  font-size: 12px;
  font-weight: 600;
  background: #1b2228;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.code-chips button:hover, .code-chips button.on {
  border-color: var(--lime);
  color: var(--lime);
}
.codes-hint { margin: 4px 0 8px; }
.login-submit {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  min-height: 48px;
  padding: 14px 12px;
  background: var(--lime);
  color: var(--graphite);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  border-radius: 10px;
}
a.login-submit { color: var(--graphite); }
a.bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.stars button { min-width: 44px; }
.me-links a, .me-links button {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  font-weight: 500;
}
.back { color: var(--muted); font-size: 14px; display: inline-block; margin-bottom: 10px; }
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(80px + var(--safe-bottom));
  background: var(--lime);
  color: var(--graphite);
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  z-index: 9;
}
.unread { box-shadow: inset 3px 0 0 var(--lime); }
.horizon {
  height: 3px;
  background: linear-gradient(90deg, #c7f000, #00e5ff);
  opacity: .7;
}
.cal-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-toggle-btn {
  flex: 1;
  background: #1b2228;
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 600;
}
.cal-toggle-btn.on {
  background: var(--lime);
  color: var(--graphite);
  border-color: var(--lime);
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.cal-nav-label {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}
.cal-nav-btn {
  min-width: 44px;
  padding: 10px 14px;
}
.cal-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cal-hint {
  margin: 0 0 12px;
  font-size: 12px;
  text-align: center;
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cal-day {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
}
.cal-day-today {
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 1px #00e5ff33;
}
.cal-day-pad { background: transparent; border-color: transparent; min-height: 0; }
.cal-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.cal-day-wd { color: var(--muted); font-size: 11px; font-weight: 600; }
.cal-day-num { font-weight: 800; font-size: 15px; }
.cal-day-evs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.cal-ev {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  background: var(--graphite);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
}
.cal-ev:hover { border-color: var(--cyan); }
.cal-ev-mine { border-color: #c7f00055; background: #1a2208; }
.cal-ev-past { opacity: 0.55; }
.cal-ev-time {
  display: block;
  color: var(--cyan);
  font-weight: 700;
  font-size: 10px;
}
.cal-ev-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-empty { color: var(--muted); font-size: 12px; }
.cal-month-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.cal-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.cal-month .cal-day {
  min-height: 72px;
  padding: 4px;
}
.cal-month .cal-day-num {
  font-size: 12px;
  margin-bottom: 2px;
}
.cal-month .cal-ev {
  padding: 2px 4px;
  font-size: 9px;
}
.cal-month .cal-ev-time { font-size: 9px; }
.cal-more { color: var(--muted); font-size: 10px; padding-left: 4px; }
.cal-filters summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
