/* Общие стили приложений АртВиль (педагог, позже — родитель). Палитра — из прототипа. */
:root {
  --paper: #F3ECE1; --paper-2: #E8DCCB;
  --card: #FFFDFA; --card-2: #FAF4EB;
  --ink: #2C2015; --ink-soft: #6E6151; --ink-faint: #8F7E68;
  --line: #E6DAC8; --line-2: #D6C6AF;
  --brand: #8A5A34; --brand-deep: #6B4524; --brand-tint: #F0E6D8; --on-brand: #FFFFFF;
  --ok: #3C8A5B; --ok-bg: #E4F1E9;
  --danger: #B33A2E; --danger-bg: #F8E1DA;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 18px 50px -20px rgba(60, 42, 24, .4);
  --r: 16px;
  /* монеты */
  --copper: #B26A3B; --copper-bg: #F6E9DF;
  --silver: #7E7B8A; --silver-bg: #ECEBEF;
  --gold: #C39430; --gold-bg: #F7EED6;
  --diam: #3E86C4; --diam-bg: #E2EEF8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16110B; --paper-2: #100C07;
    --card: #231B12; --card-2: #2A2117;
    --ink: #F3EADC; --ink-soft: #C4B5A0; --ink-faint: #A59480;
    --line: #392E20; --line-2: #46392A;
    --brand: #D3A671; --brand-deep: #E4C193; --brand-tint: #2E2317; --on-brand: #2A1B0E;
    --ok: #6FC090; --ok-bg: #1D2E24;
    --danger: #E98A78; --danger-bg: #3A241E;
    --shadow: 0 22px 60px -24px rgba(0, 0, 0, .75);
    --copper: #D69361; --copper-bg: #3A2A1E;
    --silver: #B6B2C2; --silver-bg: #2C2933;
    --gold: #E0B457; --gold-bg: #372D18;
    --diam: #7BB4E6; --diam-bg: #1B2A38;
  }
  .logo { filter: invert(1); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; line-height: 1.4;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.offscreen { position: fixed; left: -9999px; }
[hidden] { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card, .card + .eyebrow, .list + .card { margin-top: 12px; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint); margin: 22px 4px 10px;
}
.muted { color: var(--ink-soft); font-size: 13.5px; }
.faint { color: var(--ink-faint); font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.link { border: 0; background: transparent; color: var(--brand); padding: 0 6px; min-height: 36px; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--card-2);
}
input[type=file] { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.pill {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; padding: 3px 10px;
  border-radius: 99px; background: var(--brand-tint); color: var(--brand);
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }

.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--brand-tint); color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 12px; font-size: 14px;
  max-width: calc(100vw - 32px); z-index: 50; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }

.modal { border: 0; border-radius: 18px; padding: 22px; width: min(92vw, 380px); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(20, 12, 4, .55); }
.modal h3 { font-size: 19px; margin-bottom: 8px; }
.modal p { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 18px; line-height: 1.5; }

.logo { display: block; height: 46px; width: auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.ava { overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* просмотр присланных файлов (родитель и педагог) */
.viewer { margin: 10px 0 2px; }
.viewer-media { width: 100%; max-height: 60vh; border-radius: 12px; background: #000; }
audio.viewer-media { background: transparent; }
.note { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--brand); background: var(--card-2); border-radius: 0 10px 10px 0; font-size: 14px; }

/* монеты: цветная метка «+2 медь» (приложение родителя и кабинет) */
.coin { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 9px 2px 4px; border-radius: 99px; white-space: nowrap; }
.coin .pic { flex: none; }
.coin-copper { color: var(--copper); background: var(--copper-bg); }
.coin-silver { color: var(--silver); background: var(--silver-bg); }
.coin-gold { color: var(--gold); background: var(--gold-bg); }
.coin-diamond { color: var(--diam); background: var(--diam-bg); }
.coinhist { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.coinhist:first-child { border-top: 0; }
.coinhist p { margin: 0; overflow-wrap: anywhere; }
.coinhist .coin { flex: none; }
/* «История монет» — раскрывающийся список (кошелёк родителя, карточка ученика) */
.coinhist-box { padding: 0; overflow: hidden; }
.coinhist-box summary { padding: 14px 16px; cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; }
.coinhist-box summary::-webkit-details-marker { display: none; }
.coinhist-box summary::before { content: "›"; margin-right: 2px; color: var(--ink-faint); transition: transform .15s; display: inline-block; }
.coinhist-box[open] summary::before { transform: rotate(90deg); }
.coinhist-box .coinhist-list { padding: 0 16px 8px; }
.coinhist-box .coinhist-list .coinhist:first-child { border-top: 1px solid var(--line); }

/* магазин: фото приза и цена */
.authimg { display: grid; place-items: center; aspect-ratio: 1; background: var(--paper-2); color: var(--ink-faint); border-radius: 12px; overflow: hidden; }
.authimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pricechips { display: inline-flex; flex-wrap: wrap; gap: 5px; }

/* акварельные иконки (web/images/icons, см. tools/graphics) */
.pic { display: block; flex: none; object-fit: contain; }
.authimg.empty .pic { width: 58%; height: 58%; opacity: .9; }
.authimg.wide { aspect-ratio: auto; min-height: 120px; }
.authimg.wide img { height: auto; max-height: 360px; }
