:root {
  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --col: #E8ECF4;
  --text: #1D2330;
  --muted: #6A7285;
  --faint: #9AA2B4;
  --line: #E0E5EE;
  --primary: #4F63E7;
  --primary-soft: #E8EBFD;
  --accent: #4F63E7;
  --accent-soft: #E8EBFD;
  --danger: #D2493F;
  --ok: #23875A;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(24, 34, 64, .07), 0 2px 8px rgba(24, 34, 64, .05);
  --shadow-lg: 0 12px 32px rgba(24, 34, 64, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }

/* ───────── Қаңқа ───────── */

.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "view" "tabs";
}

.top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-t) + 12px) 16px 8px;
}
.top-main { flex: 1; min-width: 0; }
.top h1 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px 0 10px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.top-btn svg { width: 19px; height: 19px; }
.top-btn:active { background: var(--col); }
@media (max-width: 899px) {
  .top-btn.compact { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .top-btn.compact span { display: none; }
}

#view {
  grid-area: view;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tabs {
  grid-area: tabs;
  display: flex;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(var(--safe-b) + 6px);
}
.brand { display: none; }
.tab {
  --tab: var(--primary);
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 4px;
  border-radius: 12px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
}
.tab span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab .t-full { display: none; }
.tab.active { color: var(--tab); }
.tab.active svg { stroke-width: 2.1; }
.badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #E5484D;
  color: #fff;
  font: 700 11px/18px inherit;
  font-style: normal;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ───────── Тақта ───────── */

.chips {
  display: flex;
  gap: 8px;
  padding: 4px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px 0 12px;
  border-radius: 17px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.chip b {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}
.chip.active { background: var(--accent); color: #fff; }
.chip.active b { background: rgba(255, 255, 255, .24); color: #fff; }
.chip.active .st { background: #fff; }

.st {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--faint);
}
.st-idea { background: #E9B308; }
.st-todo { background: #4C8DF6; }
.st-doing { background: #F0803C; }
.st-done { background: #2FAE72; }

.board {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0 16px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.board::-webkit-scrollbar { display: none; }
.board.dragging { scroll-snap-type: none; }
.board::after { content: ""; flex: 0 0 4px; }

.col {
  flex: 0 0 min(84vw, 330px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--col);
  border-radius: 18px;
  scroll-snap-align: center;
}
.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px 8px;
}
.col-head h2 { flex: 1; font-size: 15px; font-weight: 700; }
.count {
  min-width: 24px;
  padding: 0 7px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .75);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.cards {
  flex: 1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 8px 4px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
.cards:empty::after {
  content: "Бос";
  display: block;
  padding: 16px 0;
  border: 1.5px dashed rgba(106, 114, 133, .35);
  border-radius: 12px;
  color: var(--faint);
  font-size: 13.5px;
  text-align: center;
}

.card {
  flex: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.card-in {
  padding: 11px 12px 10px;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.card:active .card-in { background: #FAFBFE; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.card h3, .row-card h3 {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.32;
  overflow-wrap: anywhere;
}
.card footer, .row-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}
.card-meta { display: inline-flex; align-items: center; gap: 8px; }

.card-ghost .card-in {
  background: transparent;
  box-shadow: none;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
.card-ghost .card-in > * { visibility: hidden; }
.card-drag { opacity: 1 !important; z-index: 1000; }
.card-drag .card-in { transform: rotate(2.5deg) scale(1.03); box-shadow: var(--shadow-lg); }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}
.tag-idea { background: #FFF2C2; color: #7A5600; }
.tag-task { background: #E0EBFF; color: #1E50A8; }
.tag-book { background: #DDF5E7; color: #186B43; }
.tag-course { background: #ECE6FF; color: #553BB8; }
.tag-other { background: #ECEFF4; color: #505A6E; }

.due, .cnt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.due svg, .cnt svg { width: 14px; height: 14px; }
.due.overdue { color: var(--danger); }

.sig {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sig.big { font-size: 14px; gap: 8px; margin: 6px 0 16px; white-space: normal; }
.sig b { color: var(--text); font-weight: 650; }

.ava {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c, #9AA3B5);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
}
.ava.xs { width: 18px; height: 18px; font-size: 10.5px; }
.ava.sm { width: 24px; height: 24px; font-size: 12.5px; }
.ava.xl { width: 60px; height: 60px; font-size: 26px; }
.who { display: inline-flex; }
.who .ava + .ava { margin-left: -7px; box-shadow: 0 0 0 2px #fff; }

.add { padding: 4px 8px 8px; flex: none; }
.add-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 8px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
}
.add-btn svg { width: 18px; height: 18px; }
.add-btn:active { background: rgba(255, 255, 255, .6); }
.add-form textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--accent);
  border-radius: 13px;
  background: var(--surface);
  resize: none;
  outline: none;
}
.add-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ───────── Батырмалар мен өрістер ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--col);
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .6; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.big { width: 100%; min-height: 50px; font-size: 16px; border-radius: 14px; }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: 14px; }
.btn.danger { color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
}
.icon-btn svg { width: 20px; height: 20px; }

label { display: block; color: var(--muted); font-size: 13px; font-weight: 650; }
input:not([type="date"]), .stack input {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  outline: none;
}
input:focus { border-color: var(--accent); }
.form-error { min-height: 20px; color: var(--danger); font-size: 14px; }

/* ───────── Кіру ───────── */

.auth {
  height: 100dvh;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px);
  background: linear-gradient(160deg, #EEF0FE 0%, #F3F5FA 45%, #EAF4FB 100%);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 22px 24px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 8px 40px rgba(40, 50, 100, .10);
}
.auth-card.wide { max-width: 440px; }
.auth-logo { align-self: center; border-radius: 18px; }
.auth-card h1 { font-size: 26px; font-weight: 780; letter-spacing: -.02em; text-align: center; }
.auth-sub { color: var(--muted); font-size: 14.5px; text-align: center; margin-bottom: 4px; }
fieldset {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 0;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
}
legend { padding: 0 6px; font-weight: 700; font-size: 14px; }

/* ───────── Айналатын беттер ───────── */

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 6px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.empty { color: var(--faint); font-size: 14px; padding: 10px 0; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 56px 24px;
  color: var(--faint);
  text-align: center;
}
.empty-state svg { width: 44px; height: 44px; stroke-width: 1.4; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 17px; font-weight: 650; }
.empty-state span { font-size: 14px; max-width: 280px; }

.row-card {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}

/* Таспа */
.day {
  margin: 12px 2px 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.day:first-child { margin-top: 2px; }
.feed-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.feed-item.unread { background: #F2F4FF; box-shadow: inset 0 0 0 1.5px #C9D0FA; }
.feed-item.unread::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}
.feed-body { min-width: 0; flex: 1; }
.feed-body p { font-size: 14.5px; color: var(--muted); padding-right: 16px; }
.feed-body p b { color: var(--text); }
.feed-body strong { display: block; margin-top: 2px; font-size: 15.5px; font-weight: 650; overflow-wrap: anywhere; }
.feed-body q {
  display: block;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 14.5px;
  quotes: none;
  overflow-wrap: anywhere;
}
.feed-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--faint); font-size: 12.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }

/* Баптаулар */
.panel {
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile h2 { font-size: 21px; font-weight: 750; }
.partner { display: flex; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack .btn { align-self: flex-start; }
.hint { color: var(--muted); font-size: 14.5px; margin-bottom: 12px; }
.hint b { color: var(--text); }
.steps { margin: 0; padding-left: 22px; color: var(--muted); font-size: 14.5px; display: flex; flex-direction: column; gap: 6px; }
.steps b { color: var(--text); }
.status-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ok);
  font-weight: 650;
}
.status-ok svg { width: 20px; height: 20px; stroke-width: 2.4; }

/* ───────── Карточка парағы ───────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(22, 28, 45, .38);
  animation: fade .2s;
}
.sheet {
  position: fixed;
  z-index: 41;
  left: 0;
  right: 0;
  top: calc(var(--vvo, 0px) + var(--safe-t) + 18px);
  height: calc(var(--vvh, 100dvh) - var(--safe-t) - 18px);
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.sheet-head {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 8px 16px;
}
.grab {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 38px;
  height: 4px;
  margin-left: -19px;
  border-radius: 2px;
  background: var(--line);
}
.sheet-head .icon-btn { margin-left: auto; }
.pill {
  padding: 4px 11px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.pill.gray { background: var(--col); color: var(--muted); }

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 20px;
}
.f-title {
  display: block;
  width: 100%;
  padding: 4px 0;
  border: 0;
  background: none;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.01em;
  line-height: 1.25;
  resize: none;
  outline: none;
  overflow: hidden;
}
.field { margin-bottom: 14px; }
.field > label { margin-bottom: 7px; }

.seg { display: flex; flex-wrap: wrap; gap: 7px; }
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px transparent;
}
.seg button.on {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.seg.status { display: grid; grid-template-columns: 1fr 1fr; }
.seg.status button { justify-content: flex-start; min-height: 44px; }
.readonly .seg button { pointer-events: none; }
.readonly .seg button:not(.on) { opacity: .45; }

.due-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
input[type="date"] {
  height: 40px;
  min-width: 150px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.overdue-note { color: var(--danger); font-size: 13.5px; font-weight: 650; }

.f-desc {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: 11px 13px;
  border: 1.5px solid transparent;
  border-radius: 13px;
  background: var(--bg);
  line-height: 1.45;
  resize: none;
  outline: none;
  overflow: hidden;
}
.f-desc:focus { border-color: var(--accent); background: var(--surface); }
.f-desc[readonly] { min-height: 0; }

.block { margin-top: 22px; }
.block h4, .history summary {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}
.msgs { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 88%; align-self: flex-start; }
.msg.mine { align-self: flex-end; }
.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12.5px;
  color: var(--faint);
}
.msg-meta b { color: var(--text); font-weight: 650; }
.msg.mine .msg-meta { justify-content: flex-end; }
.bubble {
  padding: 9px 13px;
  border-radius: 4px 16px 16px 16px;
  background: var(--bg);
  font-size: 15.5px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.mine .bubble { border-radius: 16px 4px 16px 16px; background: var(--accent-soft); }
.bubble a { color: var(--accent); text-decoration: underline; }

.history { margin-top: 22px; }
.history summary { cursor: pointer; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.history summary::-webkit-details-marker { display: none; }
.history summary::after { content: "›"; font-size: 18px; transition: transform .15s; }
.history[open] summary::after { transform: rotate(90deg); }
.h-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.h-item .ava { margin-top: 1px; }
.h-item b { color: var(--text); font-weight: 650; }
.h-item time { grid-column: 2; font-size: 12.5px; color: var(--faint); }

.sheet-foot { margin-top: 22px; }
.foot-note { margin-top: 4px; color: var(--faint); font-size: 12.5px; text-align: center; }

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px calc(var(--safe-b) + 8px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.composer textarea {
  flex: 1;
  max-height: 120px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  line-height: 1.35;
  resize: none;
  outline: none;
}
.composer textarea:focus { border-color: var(--accent); background: var(--surface); }
.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.send svg { width: 20px; height: 20px; }

/* ───────── Қалқымалы хабар ───────── */

#toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: calc(var(--safe-t) + 12px);
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  border-radius: 14px;
  background: #232938;
  color: #fff;
  font-size: 14.5px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -160%);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .28s;
  pointer-events: none;
  width: max-content;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ───────── Кең экран (компьютер, планшет) ───────── */

@media (min-width: 900px) {
  .app {
    grid-template-columns: 256px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "tabs top" "tabs view";
  }
  .top { padding: 26px 28px 14px; }
  .top h1 { font-size: 28px; }

  .tabs {
    flex-direction: column;
    gap: 4px;
    padding: 20px 12px;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-size: 19px; }
  .brand img { border-radius: 9px; }
  .tab {
    flex: none;
    flex-direction: row;
    gap: 12px;
    padding: 10px 12px;
    font-size: 15px;
    color: var(--muted);
  }
  .tab .t-short { display: none; }
  .tab .t-full { display: inline; }
  .tab.active { background: color-mix(in srgb, var(--tab) 11%, white); }
  .tab[data-tab="feed"] { margin-top: auto; }
  .badge { position: static; margin-left: auto; box-shadow: none; }

  .chips { display: none; }
  .board { padding: 0 28px 24px; gap: 16px; scroll-snap-type: none; }
  .col { flex: 1 1 0; min-width: 220px; max-width: 360px; }
  .page { padding: 6px 28px 32px; margin: 0; }

  .sheet {
    left: 50%;
    right: auto;
    top: 50%;
    width: min(680px, 92vw);
    height: min(860px, 90vh);
    transform: translate(-50%, -50%);
    border-radius: 22px;
    animation: pop .2s cubic-bezier(.2, .8, .2, 1);
  }
  .grab { display: none; }
  .sheet-head { padding: 16px 16px 8px 24px; }
  .sheet-body { padding: 4px 24px 24px; }
  .composer { padding: 12px 20px; border-radius: 0 0 22px 22px; }
  .seg.status { display: flex; }
  @keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
