/* ВЦ ФИИ — Mini App styles. Palette follows the logo on white:
   white surfaces, black text, royal-blue accents, 4-point sparkle star.
   Always light — the app ignores Telegram's dark theme on purpose. */

:root {
  --blue: #0B3FD9;
  --blue-press: #0934B4;
  --blue-soft: #EEF2FE;
  --ink: #0A0A0A;
  --ink-2: #2B2F3A;
  --muted: #6B7287;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --border: #D5DCEC;
  --border-strong: #B9C4DE;
  --lift: 0 1px 2px rgba(10, 20, 60, .06), 0 4px 14px -6px rgba(11, 63, 217, .22);
  --field: #FFFFFF;
  --danger: #E0322B;
  --danger-soft: #FDECEB;
  --success: #12A150;
  --success-soft: #E5F6EC;
  --warn: #C27803;
  --warn-soft: #FDF3E1;
  --shadow: 0 1px 2px rgba(10, 20, 60, .04), 0 8px 24px -12px rgba(11, 63, 217, .18);
  --skeleton: #EEF1F7;
  --skeleton-hi: #F8F9FC;
  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --font-head: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100vh);
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(var(--safe-top) + 8px) var(--gutter) calc(var(--safe-bottom) + 28px);
  overflow-x: hidden;
}
.view { position: relative; }
.view.enter { animation: screenIn .32s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter-back { animation: screenBack .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes screenIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes screenBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* ---------- boot ---------- */
.boot { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.boot-logo { width: 220px; height: auto; border-radius: 22px; background: #fff; padding: 6px; }
.boot-dots { display: flex; gap: 8px; }
.boot-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: dot 1s infinite ease-in-out; }
.boot-dots span:nth-child(2) { animation-delay: .15s; }
.boot-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- headings ---------- */
.h-xl, .h-lg, .h-md, .h-sm {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1.05;
  margin: 0;
  overflow-wrap: anywhere;
}
.h-xl { font-size: 30px; font-weight: 900; }
.h-lg { font-size: 24px; font-weight: 900; }
.h-md { font-size: 17px; font-weight: 800; }
.h-sm { font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.blue { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- page header with orbit ---------- */
.page-head {
  position: relative;
  padding: 18px 0 20px;
  margin-bottom: 4px;
  isolation: isolate;
}
.page-head .orbit {
  position: absolute; z-index: -1;
  right: -40px; top: -6px;
  width: 260px; height: 110px;
  pointer-events: none;
  color: var(--blue);
  opacity: .9;
}
.page-head .eyebrow { margin-bottom: 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-weight: 700; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--blue);
  max-width: 100%; overflow-wrap: anywhere;
}
.star { display: inline-block; width: 1em; height: 1em; color: var(--blue); flex: none; }
.star svg { width: 100%; height: 100%; display: block; }
.page-head .h-lg { max-width: 85%; }

/* ---------- home hero ---------- */
.hero { position: relative; padding: 8px 0 10px; isolation: isolate; }
.hero-logo {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 3 / 1.55;
  display: flex; align-items: center; justify-content: center;
}
.hero-logo img { width: 112%; max-width: none; height: auto; }
.hero-greet { margin-top: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hero-greet .h-lg { flex: 1; min-width: 0; }
.profile-link {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  font-weight: 700; font-size: 13px; color: var(--blue);
  border: 1.5px solid var(--blue); background: var(--blue-soft);
  cursor: pointer;
}
.profile-link svg { width: 16px; height: 16px; }

/* ---------- hours split block (ВЦ / И) ---------- */
.hours-card {
  display: flex;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 16px 0;
  min-height: 132px;
  box-shadow: var(--shadow);
}
.hours-card .hc-dark {
  flex: 1 1 auto; min-width: 0;
  background: var(--card); color: var(--ink);
  padding: 16px 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.hours-card .hc-dark .orbit-mini {
  position: absolute; right: -30px; bottom: -22px; width: 170px; height: 80px;
  color: #0B3FD9; opacity: .35; pointer-events: none;
}
.hours-card .hc-label { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hours-card .hc-num {
  font-family: var(--font-head); font-weight: 900;
  font-size: 56px; line-height: .95; letter-spacing: -.03em;
  position: relative;
  overflow-wrap: anywhere;
}
.hours-card .hc-blue {
  flex: 0 0 34%;
  background: #0B3FD9; color: #fff;
  padding: 16px 14px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  position: relative;
}
.hours-card .hc-unit { font-family: var(--font-head); font-weight: 900; font-size: 26px; line-height: 1; text-transform: uppercase; }
.hours-card .hc-sub { font-size: 12px; font-weight: 600; opacity: .9; line-height: 1.3; }
.hours-card .hc-blue .star { color: #fff; width: 22px; height: 22px; }
.hours-card.big .hc-num { font-size: 68px; }
.hours-card.tap { cursor: pointer; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative;
  min-height: 118px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer; text-align: left;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .2s ease;
}
.tile .tile-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--blue);
}
.tile .tile-icon svg { width: 20px; height: 20px; }
.tile .h-sm { font-size: 14px; }
.tile .tile-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tile { box-shadow: var(--lift); border: 2px solid var(--border-strong); }
.tile.blue-tile { background: #0B3FD9; border-color: #0B3FD9; color: #fff; }
.tile.blue-tile .tile-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.tile.blue-tile .tile-sub { color: rgba(255, 255, 255, .8); }
.tile.wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 14px; justify-content: flex-start; }
.tile-badges { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; }

/* ---------- pressed states ---------- */
.tap, .btn, .tile, .card.link, .tab, .chip-btn, .icon-btn, .profile-link, .switch {
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease, box-shadow .2s ease;
  user-select: none; -webkit-user-select: none;
}
.tap:active, .btn:active:not(:disabled), .tile:active, .card.link:active, .tab:active, .chip-btn:active, .icon-btn:active, .profile-link:active {
  transform: scale(.97);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 18px;
  border-radius: 14px; border: 1px solid transparent;
  font-family: var(--font-head); font-weight: 800; font-size: 13px;
  letter-spacing: .03em; text-transform: uppercase;
  cursor: pointer; text-align: center; line-height: 1.15;
  width: 100%;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px -6px rgba(11, 63, 217, .55); }
.btn-primary:active:not(:disabled) { background: var(--blue-press); }
.btn-dark { background: var(--blue-soft); color: var(--blue); border: 2px solid var(--blue); box-shadow: var(--lift); }
.btn-dark:active:not(:disabled) { background: #DDE6FD; }
.btn-ghost { background: #fff; border: 2px solid var(--border-strong); color: var(--ink); box-shadow: var(--lift); }
.btn-ghost:active:not(:disabled) { background: var(--blue-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 2px solid rgba(224, 50, 43, .35); }
.btn-success { background: var(--success); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-sm { min-height: 38px; padding: 8px 12px; font-size: 11px; border-radius: 11px; width: auto; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--ink); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 6px; padding: 4px;
  background: #F3F5FA; border: 1px solid var(--border); border-radius: 14px;
  margin-bottom: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 10px; border-radius: 10px;
  font-weight: 700; font-size: 13px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.tab.active { background: var(--blue); color: #fff; }
.tab .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: var(--blue-soft); color: var(--blue);
}
.tab.active .count { background: rgba(255, 255, 255, .18); color: #fff; }
.tab .count.hot { background: var(--danger); color: #fff; }
.tabs.grid4 { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1.05fr); gap: 4px; }
.tabs.grid4 .tab { padding: 9px 3px; font-size: 11.5px; flex-direction: column; gap: 3px; min-width: 0; }
.tabs.grid4 .tab span.lbl { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- cards ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  position: relative; overflow: hidden;
}
.card.link { cursor: pointer; border-color: var(--border-strong); box-shadow: var(--lift); }
.card + .card { margin-top: 0; }
.section { margin-top: 18px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }

.event-card { display: flex; gap: 14px; align-items: stretch; }
.date-block {
  flex: none; width: 58px; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; text-align: center;
  font-family: var(--font-head);
}
.date-block { border: 1.5px solid var(--blue); }
.date-block .d { background: #fff; color: var(--ink); font-weight: 900; font-size: 22px; padding: 8px 0 6px; line-height: 1; }
.date-block .m { background: #0B3FD9; color: #fff; font-weight: 800; font-size: 10px; padding: 5px 0; text-transform: uppercase; letter-spacing: .04em; }
.date-block.past { border-color: var(--border); }
.date-block.past .d { color: var(--muted); }
.date-block.past .m { background: var(--muted); }
.event-card .body { flex: 1; min-width: 0; }
.event-card.has-photo { flex-wrap: wrap; }
.event-cover {
  flex: 0 0 calc(100% + 32px); width: calc(100% + 32px); max-width: none;
  margin: -16px -16px 0; aspect-ratio: 16 / 9; object-fit: cover; background: var(--skeleton);
}
.detail-cover {
  display: block; width: calc(100% + 36px); max-width: none; margin: -18px -18px 16px;
  aspect-ratio: 16 / 9; object-fit: cover; background: var(--skeleton);
}
.photo-pick { border-radius: 14px; overflow: hidden; }
.photo-pick.has img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; border: 1.5px solid var(--border-strong); }
.photo-pick.has .btn-row { margin-top: 8px; }
.empty-pick {
  width: 100%; min-height: 120px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed var(--blue); background: var(--blue-soft); color: var(--blue);
  font-weight: 800; font-size: 15px;
}
.empty-pick svg { width: 26px; height: 26px; }
.empty-pick small { font-weight: 600; font-size: 12px; color: var(--muted); }
.loading-pick { cursor: default; animation: shimmer 1.2s linear infinite; }
.event-card .title { font-weight: 800; font-size: 16px; line-height: 1.25; margin: 0 0 4px; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.meta svg { width: 14px; height: 14px; flex: none; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.3;
  background: var(--blue-soft); color: var(--blue);
  white-space: nowrap;
}
.chip.hours { background: var(--blue); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 11px; }
.chip.ok { background: var(--success-soft); color: var(--success); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.grey { background: var(--skeleton); color: var(--muted); }
.chip.urgent { background: var(--danger); color: #fff; }
.chip .star { width: 10px; height: 10px; color: currentColor; }
.chip.role { white-space: normal; max-width: 100%; text-align: left; }

.badge-dot {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; background: var(--danger);
}
.badge-dot.blue { background: #0B3FD9; }
.tile.blue-tile .badge-dot.blue { background: #fff; color: #0B3FD9; }

/* ---------- detail ---------- */
.detail-hero { padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); position: relative; overflow: hidden; isolation: isolate; }
.detail-hero .orbit { position: absolute; right: -50px; top: -20px; width: 240px; height: 110px; color: var(--blue); opacity: .55; z-index: -1; pointer-events: none; }
.detail-hero .h-md { font-size: 20px; line-height: 1.15; margin: 10px 0 12px; }
.kv { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.kv-row { display: flex; gap: 12px; align-items: flex-start; }
.kv-row .ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue); }
.kv-row .ic svg { width: 17px; height: 17px; }
.kv-row .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv-row .v { font-weight: 700; overflow-wrap: anywhere; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); margin: 0; }
.progress { height: 8px; border-radius: 4px; background: var(--skeleton); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; transition: width .4s ease; }

.split-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat .n { font-family: var(--font-head); font-weight: 900; font-size: 26px; line-height: 1; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; }

.history-item { display: flex; align-items: center; gap: 12px; }
.history-item .body { flex: 1; min-width: 0; }
.history-item .t { font-weight: 700; overflow-wrap: anywhere; }
.history-item .h {
  font-family: var(--font-head); font-weight: 900; font-size: 18px; flex: none; text-align: right;
}
.history-item .h.pending { color: var(--warn); }
.history-item .h.absent { color: var(--muted); }
.history-item .h.credited { color: var(--blue); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); font-weight: 600; min-height: 0; }
.field .err:empty { display: none; }
.input, .textarea, .select {
  width: 100%; min-height: 50px;
  padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--border-strong); background: var(--field);
  font-size: 16px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7287' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: var(--danger); }
input[type="datetime-local"].input { min-width: 0; display: block; }
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > * { min-width: 0; }

.check-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--border-strong);
  cursor: pointer;
}
.check-row .txt { font-weight: 700; }
.check-row .txt small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 15px; background: var(--skeleton); transition: background-color .2s ease; }
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.3, .7, .3, 1);
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch.red input:checked + .track { background: var(--danger); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--blue-soft); }

/* ---------- onboarding ---------- */
.onb { padding-top: 6px; }
.onb .hero-logo { margin-bottom: 20px; }
.onb .h-xl { margin-bottom: 8px; }
.onb .lead { color: var(--muted); margin: 0 0 22px; }

/* ---------- attendance ---------- */
.att-item { display: flex; flex-direction: column; gap: 10px; }
.att-top { display: flex; align-items: center; gap: 12px; }
.att-top .who { flex: 1; min-width: 0; }
.att-top .who .n { font-weight: 800; overflow-wrap: anywhere; }
.att-top .who .s { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.att-bottom { display: flex; align-items: center; gap: 10px; }
.att-bottom .input { min-height: 40px; padding: 8px 12px; width: 96px; font-size: 15px; }
.att-bottom .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.att-item.off { opacity: .62; }
.att-item.off .att-bottom { display: none; }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5;
  margin: 18px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 22%);
}
.banner {
  display: flex; gap: 12px; align-items: center;
  padding: 14px; border-radius: var(--radius); margin-bottom: 14px;
  background: var(--success-soft); color: var(--success); font-weight: 700;
}
.banner.info { background: var(--blue-soft); color: var(--blue); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner .star, .banner > svg { color: currentColor; width: 20px; height: 20px; flex: none; }

.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }
.results { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.result-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; background: var(--field); border: 1px solid var(--border); cursor: pointer;
}
.result-row .who { flex: 1; min-width: 0; }
.result-row .n { font-weight: 700; overflow-wrap: anywhere; }
.result-row .s { font-size: 12px; color: var(--muted); }

/* ---------- users ---------- */
.user-row { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 900; font-size: 14px;
  background: var(--blue-soft); color: var(--blue);
}
.avatar.admin { background: #0B3FD9; color: #fff; }
.user-row .who { flex: 1; min-width: 0; }
.user-row .n { font-weight: 800; overflow-wrap: anywhere; }
.user-row .s { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.user-row .hrs { font-family: var(--font-head); font-weight: 900; font-size: 16px; text-align: right; flex: none; }
.user-row .hrs small { display: block; font-family: var(--font-body); font-size: 11px; color: var(--muted); font-weight: 600; }
.user-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.title-edit { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- tasks ---------- */
.task-card .title { font-weight: 800; font-size: 16px; line-height: 1.25; margin: 0 0 6px; overflow-wrap: anywhere; padding-right: 4px; }
.task-card.done .title { text-decoration: line-through; color: var(--muted); }
.task-card.urgent-edge::before, .task-card.overdue-edge::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--warn);
}
.task-card.overdue-edge::before { background: var(--danger); }
.deadline-overdue { color: var(--danger) !important; font-weight: 700; }
.people { display: flex; flex-direction: column; gap: 8px; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-list:not(:empty) { margin-bottom: 4px; }
.file-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px;
  border: 1.5px solid var(--border-strong); border-radius: 12px; background: #fff;
}
.file-row .file-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue); }
.file-row .file-ic svg { width: 18px; height: 18px; }
.file-row .who { flex: 1; min-width: 0; }
.file-row .n {
  font-weight: 700; font-size: 14px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.file-row .s { font-size: 12px; color: var(--muted); }
.file-actions { display: flex; gap: 6px; flex: 1 0 100%; padding-left: 44px; }
#tk-pending .file-actions { flex: none; padding-left: 0; }
.file-actions .icon-btn { width: 36px; height: 36px; color: var(--blue); border: 1.5px solid var(--border-strong); }
.file-actions .icon-btn.danger { color: var(--danger); }
.icon-btn.loading { opacity: .5; pointer-events: none; }
.note-box { background: var(--field); border: 1px solid var(--border); border-radius: 12px; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- empty / error / skeleton ---------- */
.empty { text-align: center; padding: 30px 16px 26px; color: var(--muted); }
.empty .art { width: 64px; height: 64px; margin: 0 auto 14px; color: var(--blue); }
.empty .art svg { width: 100%; height: 100%; }
.empty .h-sm { color: var(--ink); margin-bottom: 6px; font-size: 14px; }
.empty p { margin: 0 auto 14px; max-width: 280px; font-size: 14px; }
.empty .btn { max-width: 260px; }
.empty.error .art { color: var(--danger); }
.orbit-anim { transform-origin: 50% 50%; }
.empty .art .sparkle { animation: twinkle 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.7) rotate(20deg); opacity: .7; } }

.sk {
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-hi) 50%, var(--skeleton) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 10px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-card { height: 96px; border-radius: var(--radius); }
.sk-line { height: 14px; margin: 8px 0; }
.sk-title { height: 28px; width: 70%; margin: 6px 0 14px; }
.sk-hero { height: 132px; border-radius: var(--radius); margin: 16px 0; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 16px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 var(--gutter); z-index: 100; pointer-events: none;
}
.toast {
  max-width: 520px; width: 100%;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 15px; border-radius: 14px;
  background: var(--ink); color: #fff;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
  animation: toastIn .25s cubic-bezier(.2, .8, .2, 1) both;
  pointer-events: auto; overflow-wrap: anywhere;
}
.toast.error { background: var(--danger); }
.toast.success { background: #0B3FD9; }
.toast .star { color: #fff; width: 16px; height: 16px; margin-top: 2px; }
.toast.out { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

.spacer { height: 12px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 22px; }
.hidden { display: none !important; }

@media (max-width: 380px) {
  .h-xl { font-size: 26px; }
  .h-lg { font-size: 21px; }
  .hours-card .hc-num { font-size: 46px; }
  .hours-card.big .hc-num { font-size: 54px; }
  .hours-card .hc-unit { font-size: 22px; }
  .tile { min-height: 108px; padding: 14px; }
  .row2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .view.enter, .view.enter-back { animation: none; }
}
