/* Чёрно-белая тема в духе Tesla: только чёрный, белый и серые. Состояния различаются формой и текстом, не цветом. */
:root {
  --bg: #000;
  --surface: #0f0f0f;
  --surface-2: #1a1a1a;
  --line: #262626;
  --text: #fff;
  --muted: #8f8f8f;
  --dim: #5c5c5c;
  --on-text: #000;
  --scrim: rgba(0, 0, 0, .72);
  --radius: 14px;
  --font: -apple-system, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
:root[data-theme="light"] {
  --bg: #f4f4f4;
  --surface: #fff;
  --surface-2: #ececec;
  --line: #dedede;
  --text: #000;
  --muted: #6e6e6e;
  --dim: #a0a0a0;
  --on-text: #fff;
  --scrim: rgba(255, 255, 255, .72);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; font-size: 15px; line-height: 1.45; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }

/* ---- Кнопки ---- */
.btn { min-height: 46px; padding: 0 20px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.btn.main { background: var(--text); color: var(--on-text); font-weight: 500; }
.btn.lnk { background: none; color: var(--muted); font-size: 13px; padding: 0 8px; min-height: 40px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active { opacity: .8; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--muted); }
.pill:hover { color: var(--text); border-color: var(--dim); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---- Вход ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px 28px; }
.brand { font-size: 13px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; }
.brand span { color: var(--muted); margin-left: 8px; }
.login h1 { font-size: 28px; font-weight: 300; letter-spacing: -.01em; margin: 18px 0 22px; }

label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.in { width: 100%; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; padding: 13px 14px; font-size: 17px; font-weight: 300; outline: none; }
.in:focus { border-color: var(--text); }
.in:disabled { background: transparent; border-color: var(--line); -webkit-text-fill-color: var(--text); opacity: .75; cursor: default; }
.in.bad { outline: 2px dashed var(--text); outline-offset: 2px; }
.err { font-size: 14px; min-height: 0; margin: 4px 0 12px; }
.login .btn { width: 100%; margin-top: 6px; }

/* ---- Каркас ---- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.bar .right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: var(--muted); }
.body { display: flex; max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; gap: 36px; }
.nav { width: 180px; flex: none; display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav span { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: 12px; font-size: 15px; color: var(--muted); text-decoration: none; }
.nav a.on { background: var(--surface-2); color: var(--text); }
.nav i { font-style: normal; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.main { flex: 1; min-width: 0; }
.main h1 { font-size: 30px; font-weight: 300; letter-spacing: -.01em; margin-bottom: 8px; }
.lead { color: var(--muted); max-width: 640px; margin-bottom: 26px; }

/* ---- Карточки тарифов ---- */
.cards { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.card { flex: 1; min-width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.card.editing { border-color: var(--text); }
.head { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.head h2 { font-size: 22px; font-weight: 300; }
.badge { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--text); border-radius: 999px; padding: 2px 9px; }
.saved { margin-left: auto; font-size: 13px; color: var(--muted); }
.meta { font-size: 13px; color: var(--muted); margin: 4px 0 16px; }
.adv { margin: 4px 0 8px; }
.adv summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 6px 0 12px; }
.ex { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.ex b { color: var(--text); font-weight: 500; }
.acts { display: flex; gap: 8px; align-items: center; margin-top: 18px; }
.acts .main { flex: 1; }
.acts .lnk { margin-left: auto; }
.hist { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.hist summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
.hist table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.hist td { padding: 9px 4px; border-top: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.hist td:first-child { white-space: nowrap; padding-right: 10px; }
.hist td b { color: var(--text); font-weight: 400; }

/* ---- Подтверждение ---- */
.modal { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal .box { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--dim); border-radius: 22px; padding: 26px; }
.modal h3 { font-size: 22px; font-weight: 300; margin-bottom: 14px; }
.modal ul { list-style: none; margin: 0 0 14px; }
.modal li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.modal li b { color: var(--text); font-weight: 400; text-align: right; }
.modal .tiny { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.modal .row { display: flex; gap: 8px; margin-top: 14px; }
.modal .row .btn { flex: 1; }

@media (max-width: 760px) {
  .body { flex-direction: column; padding: 18px 16px 48px; gap: 18px; }
  .nav { width: auto; flex-direction: row; flex-wrap: wrap; }
  .bar { padding: 12px 16px; }
  .card { flex: 1 1 100%; min-width: 0; }
  .head { flex-wrap: wrap; }
  .bar .right { gap: 6px; }
  .bar .pill { padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
