/* ============ Màu sắc: sáng (be) và tối ============ */
:root, [data-theme="light"] {
  --bg: #F3ECE0;
  --panel: #FAF6EF;
  --paper: #FFFCF6;
  --surface: #FFFFFF;
  --line: #E8DECE;
  --line-strong: #D8C9B2;
  --ink: #3B332B;
  --ink-soft: #5E5347;
  --muted: #918372;
  --accent: #A86B3C;
  --accent-ink: #8A5329;
  --accent-soft: #F1E2CF;
  --on-accent: #FFF9F1;
  --hover: #F1E8DA;
  --danger: #B5473A;
  --danger-soft: #F6E1DC;
  --ok: #5E8B5A;
  --floating: rgba(250, 246, 239, .96);
  --backdrop: rgba(60, 45, 25, .28);
  --toast: #3B332B;
  --toast-ink: #FBF5EC;
  --shadow: 0 1px 2px rgba(80, 58, 30, .06), 0 6px 20px rgba(80, 58, 30, .08);
  --shadow-lg: 0 10px 40px rgba(70, 50, 25, .18);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #1A1714;
  --panel: #221E1A;
  --paper: #1F1C18;
  --surface: #2B2620;
  --line: #342E27;
  --line-strong: #463E34;
  --ink: #EDE5D8;
  --ink-soft: #CDC1B0;
  --muted: #998C7A;
  --accent: #C68652;
  --accent-ink: #E3A774;
  --accent-soft: #3A2B1E;
  --on-accent: #1E1812;
  --hover: #2C2620;
  --danger: #E0705F;
  --danger-soft: #3D2420;
  --ok: #7DB477;
  --floating: rgba(36, 32, 27, .95);
  --backdrop: rgba(0, 0, 0, .5);
  --toast: #EDE5D8;
  --toast-ink: #221E1A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
[data-theme="chalk"] {
  --bg: #17251F;
  --panel: #1C2D26;
  --paper: #233B31;
  --surface: #24382F;
  --line: #2D4339;
  --line-strong: #3C574A;
  --ink: #EEF2E8;
  --ink-soft: #CBD6C6;
  --muted: #93A497;
  --accent: #E0B464;
  --accent-ink: #F0CB86;
  --accent-soft: #33402C;
  --on-accent: #1A2620;
  --hover: #24372E;
  --danger: #EF8270;
  --danger-soft: #45302A;
  --ok: #8CCB86;
  --floating: rgba(28, 45, 38, .95);
  --backdrop: rgba(0, 0, 0, .5);
  --toast: #EEF2E8;
  --toast-ink: #1C2D26;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
:root {
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent-ink); }
.i { flex-shrink: 0; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* Ngôn ngữ của khối nội dung tĩnh */
html[lang="vi"] .l-en, html[lang="en"] .l-vi { display: none !important; }

#app { display: flex; height: 100vh; height: 100dvh; }

/* ---------- Thanh bên ---------- */
#sidebar {
  width: 232px; flex-shrink: 0; background: var(--bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 18px; }
.logo { width: 38px; height: 38px; border-radius: 11px; display: block; box-shadow: 0 3px 10px rgba(148, 89, 45, .2); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.brand-sub { font-size: 12px; color: var(--muted); }

#studentNav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.side-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 16px 8px 6px;
}
.side-label button { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-soft); }
.side-label button:hover { background: var(--hover); color: var(--accent-ink); }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border-radius: 10px; text-align: left; color: var(--ink-soft); transition: background .12s;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.nav-item .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.nav-item .count { font-size: 12px; color: var(--muted); }
.avatar {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.class { background: var(--accent-soft); color: var(--accent-ink); }
.avatar.lg { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; }
.avatar.round { border-radius: 50%; }
.side-empty { font-size: 13px; color: var(--muted); padding: 6px 10px; line-height: 1.5; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.profile-card {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 12px; text-align: left;
}
.profile-card:hover { background: var(--hover); }
.profile-card .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.profile-card .pn { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card .pr { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card > div { min-width: 0; flex: 1; }
.foot-row { display: flex; align-items: center; gap: 2px; }
.lang-seg button { padding: 4px 8px; font-size: 12px; }

/* ---------- Cột học sinh ---------- */
#panel {
  width: 304px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 10px; }
.panel-head .ttl { flex: 1; min-width: 0; }
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.2px; }
.panel-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.next-lesson {
  margin: 0 16px 10px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink);
  font-size: 12.5px; display: flex; align-items: center; gap: 7px; font-weight: 500;
}
.tabs { display: flex; gap: 2px; padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; padding: 7px 0; border-radius: 9px; font-weight: 500; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
}
.tab:hover { background: var(--hover); color: var(--ink-soft); }
.tab.active { background: var(--accent-soft); color: var(--accent-ink); }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }

.search {
  display: flex; align-items: center; gap: 8px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; margin-bottom: 10px; color: var(--muted);
}
.search input { border: 0; outline: 0; background: none; padding: 8px 0; flex: 1; min-width: 0; color: var(--ink); }

.group-label { font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 4px 6px; display: flex; align-items: center; gap: 6px; }
.group-label.today { color: var(--accent-ink); }
.group-label .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }

.board-card {
  display: flex; gap: 10px; align-items: center; padding: 7px; border-radius: 11px;
  cursor: pointer; border: 1px solid transparent; transition: background .12s, border-color .12s;
}
.board-card:hover { background: var(--hover); }
.board-card.active { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow); }
.board-card .thumb { width: 64px; height: 44px; border-radius: 7px; flex-shrink: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.board-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.board-card .meta { flex: 1; min-width: 0; }
.board-card .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-card .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.board-card .more { opacity: 0; }
.board-card:hover .more, .board-card.active .more { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; line-height: 1.6; font-size: 13.5px; }
.empty .big { font-size: 15px; color: var(--ink-soft); font-weight: 600; margin-bottom: 4px; }

/* Tài liệu */
.dropzone {
  display: block; border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 16px 12px; text-align: center;
  color: var(--muted); cursor: pointer; background: var(--paper); transition: all .15s; font-size: 13px; line-height: 1.5; margin-bottom: 8px;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent-ink); }
.dropzone .i { margin: 0 auto 6px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; }
.file-row:hover { background: var(--hover); }
.ficon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: .02em; color: #fff; }
.fmeta { flex: 1; min-width: 0; }
.fname { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.fsub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.factions { display: flex; gap: 2px; align-items: center; }

/* Lịch học */
.week-nav { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.week-nav .wl { flex: 1; text-align: center; font-weight: 600; font-size: 13.5px; }
.week-nav .wl small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.day { border-radius: 11px; padding: 6px 8px 8px; margin-bottom: 4px; }
.day.today { background: var(--accent-soft); }
.day-h { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 0 4px; }
.day.today .day-h { color: var(--accent-ink); }
.day-h button { opacity: 0; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.day:hover .day-h button { opacity: 1; }
.day-h button:hover { background: var(--hover); color: var(--ink); }
.day-empty { font-size: 12px; color: var(--muted); opacity: .7; padding-left: 2px; }
.sess {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 9px; padding: 6px 6px 6px 9px; margin-bottom: 4px; cursor: pointer;
}
.sess:hover { border-color: var(--line-strong); }
.sess.off { opacity: .55; }
.sess.off .st, .sess.off .sj { text-decoration: line-through; }
.sess .st { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sess .sm { flex: 1; min-width: 0; }
.sess .sj { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess .sn { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess .tag { font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.sess .avatar { width: 20px; height: 20px; border-radius: 6px; font-size: 10px; }
.sec-h { font-size: 12.5px; font-weight: 700; margin: 16px 2px 8px; display: flex; align-items: center; justify-content: space-between; }
.week-note { width: 100%; min-height: 70px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 9px 11px; outline: none; line-height: 1.5; }
.week-note:focus, .note-area:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.fixed-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 9px; font-size: 13px; }
.fixed-row:hover { background: var(--hover); }
.fixed-row .fd { font-weight: 600; width: 64px; flex-shrink: 0; font-size: 12.5px; }
.fixed-row .ft { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.fixed-row .fj { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.note-area {
  width: 100%; min-height: 320px; resize: vertical; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); padding: 12px 14px; line-height: 1.6; outline: none;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px;
  font-weight: 500; font-size: 13.5px; transition: background .12s, color .12s, box-shadow .12s; white-space: nowrap;
}
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px rgba(168, 107, 60, .25); }
.btn.primary:hover { filter: brightness(.93); }
.btn.ghost { color: var(--ink-soft); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn.outline { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-soft); }
.btn.outline:hover { background: var(--surface); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.94); }
.btn.danger-text { color: var(--danger); margin-right: auto; }
.btn.danger-text:hover { background: var(--danger-soft); }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-soft);
  transition: background .12s, color .12s;
}
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Khu vực bảng ---------- */
#stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.owner-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 20px;
  background: var(--bg); font-size: 12.5px; font-weight: 500; color: var(--ink-soft); max-width: 160px; flex-shrink: 0;
}
.owner-chip:hover { background: var(--hover); }
.owner-chip .avatar { width: 22px; height: 22px; border-radius: 50%; font-size: 11px; }
.owner-chip span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-input {
  border: 1px solid transparent; background: none; font-weight: 600; font-size: 15.5px; padding: 6px 8px;
  border-radius: 9px; outline: none; min-width: 80px; width: 230px; letter-spacing: -.1px;
}
.title-input:hover { background: var(--bg); }
.title-input:focus { background: var(--surface); border-color: var(--line-strong); }
.date-pill, .bg-pick {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; height: 32px; border-radius: 9px;
  color: var(--muted); background: var(--bg); cursor: pointer; flex-shrink: 0;
}
.date-pill:hover, .bg-pick:hover { background: var(--hover); color: var(--ink-soft); }
.date-pill input, .bg-pick select { border: 0; background: none; outline: none; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.bg-pick select { appearance: none; -webkit-appearance: none; padding-right: 2px; }
.bg-pick option { background: var(--panel); color: var(--ink); }
.status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.status .d { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.status.saving .d { background: #D9A441; }

#canvasWrap { position: relative; flex: 1; overflow: hidden; background: var(--paper); }
#board { position: absolute; inset: 0; touch-action: none; display: block; cursor: crosshair; }
#board.t-hand { cursor: grab; }
#board.panning { cursor: grabbing; }
#board.t-text { cursor: text; }
#board.t-eraser, #board.t-laser { cursor: none; }

.floating {
  position: absolute; background: var(--floating); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); z-index: 5;
}
#toolbar { left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 5px; }
.tool {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-soft);
  position: relative; transition: background .12s, color .12s;
}
.tool:hover { background: var(--hover); color: var(--ink); }
.tool.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px rgba(168, 107, 60, .3); }
.tool .swatch-mini { position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--panel); }
.tool:disabled { opacity: .35; pointer-events: none; }
.tsep { width: 1px; height: 26px; background: var(--line-strong); margin: 0 5px; }

#props {
  left: 50%; bottom: 76px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; min-height: 46px; white-space: nowrap;
}
#props:empty { display: none; }
.swatches { display: flex; gap: 5px; align-items: center; }
.sw { width: 24px; height: 24px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); transition: transform .1s; }
.sw:hover { transform: scale(1.12); }
.sw.active::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); }
.sw.custom { background: conic-gradient(#e66, #eb5, #6b6, #5ad, #95d, #e66); overflow: visible; }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.psep { width: 1px; height: 24px; background: var(--line-strong); }
.size-ctl { display: flex; align-items: center; gap: 8px; }
.size-ctl .prev { width: 30px; height: 30px; display: grid; place-items: center; }
.size-ctl .prev span { border-radius: 50%; display: block; }
.size-ctl .val { font-size: 12px; color: var(--muted); width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 110px; height: 4px; background: var(--line-strong); border-radius: 4px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); cursor: pointer; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.seg button:hover { color: var(--ink-soft); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.icons button { padding: 5px 7px; }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }
.prop-hint { font-size: 12.5px; color: var(--muted); }

#zoombar { right: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 13px; }
#zoombar .zl { font-size: 12px; width: 46px; text-align: center; color: var(--ink-soft); font-variant-numeric: tabular-nums; border-radius: 8px; padding: 6px 0; }
#zoombar .zl:hover { background: var(--hover); }

#selbar { display: flex; gap: 2px; padding: 4px; border-radius: 12px; }
#selbar .icon-btn { width: 32px; height: 32px; }
#selbar .cdot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

#dropHint {
  position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 18px; background: color-mix(in srgb, var(--paper) 80%, transparent);
  display: none; place-items: center; font-weight: 600; color: var(--accent-ink); z-index: 20; pointer-events: none; font-size: 16px;
}
#canvasWrap.dragover #dropHint { display: grid; }

.text-editor {
  position: absolute; z-index: 8; border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--paper) 85%, transparent);
  outline: none; resize: none; overflow: hidden; padding: 0; margin: 0; line-height: 1.3; min-width: 40px;
  font-family: var(--font); white-space: pre; border-radius: 4px;
}

/* ---------- Hộp thoại ---------- */
.modal-back { position: fixed; inset: 0; background: var(--backdrop); display: grid; place-items: center; z-index: 100; animation: fade .15s ease; }
.modal {
  background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; animation: pop .18s ease; border: 1px solid var(--line);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 700; }
.modal-body { padding: 8px 20px 12px; overflow-y: auto; line-height: 1.55; }
.modal-body p { margin: 4px 0 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 20px 18px; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input[type=text], .field input[type=date], .field input[type=time], .field input[type=number], .field input[type=email], .field input[type=password], .field input[type=tel], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 9px 12px; outline: none;
}
.field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row2 { display: flex; gap: 10px; } .row2 > * { flex: 1; min-width: 0; }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-pick button { width: 30px; height: 30px; border-radius: 9px; position: relative; }
.color-pick button.active::after { content: ""; position: absolute; inset: -4px; border: 2px solid var(--ink-soft); border-radius: 12px; }
.set-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.set-section h4 { margin: 0 0 10px; font-size: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13.5px; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 4px 0 10px; }
.switch input { display: none; }
.switch .knob { width: 38px; height: 22px; border-radius: 12px; background: var(--line-strong); position: relative; flex-shrink: 0; transition: background .15s; margin-top: 1px; }
.switch .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { left: 19px; }
.switch .lbl { font-weight: 500; font-size: 13.5px; } .switch .lbl small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; color: var(--ink-soft); }
kbd { background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; font-family: var(--font); font-size: 12px; }
.radio-cards { display: flex; gap: 8px; }
.radio-cards label {
  flex: 1; border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--surface);
  font-size: 13px; line-height: 1.4;
}
.radio-cards label b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.radio-cards label span { color: var(--muted); font-size: 12px; }
.radio-cards input { display: none; }
.radio-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 6px 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Hồ sơ */
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-edit .big-av {
  width: 84px; height: 84px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-size: 32px; font-weight: 700; overflow: hidden; flex-shrink: 0; cursor: pointer; position: relative;
}
.avatar-edit .big-av img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit .big-av::after {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E") center no-repeat;
  opacity: 0; transition: opacity .15s;
}
.avatar-edit .big-av:hover::after { opacity: 1; }
.avatar-edit .av-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---------- Menu nổi ---------- */
.popmenu {
  position: fixed; z-index: 120; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 5px; min-width: 200px; animation: pop .12s ease;
}
.popmenu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; color: var(--ink-soft); font-size: 13.5px; }
.popmenu button:hover { background: var(--hover); color: var(--ink); }
.popmenu button.danger { color: var(--danger); }
.popmenu button.danger:hover { background: var(--danger-soft); }
.popmenu button small { display: block; font-size: 11.5px; color: var(--muted); }
.popmenu .sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ---------- Thông báo ---------- */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--toast); color: var(--toast-ink); padding: 9px 16px; border-radius: 11px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: pop .18s ease; max-width: 480px; }
.toast.err { background: #8F3A2F; color: #fff; }

/* ---------- Trang giới thiệu ---------- */
.welcome { position: fixed; inset: 0; z-index: 90; background: var(--backdrop); display: grid; place-items: center; padding: 20px; animation: fade .2s ease; }
.welcome-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: min(760px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 28px 32px 24px; animation: pop .2s ease;
}
.wl-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 6px; }
.wl-head img { border-radius: 16px; flex-shrink: 0; }
.welcome h1 { font-size: 24px; margin: 4px 0 8px; letter-spacing: -.4px; line-height: 1.25; }
.wl-lead { color: var(--ink-soft); line-height: 1.6; margin: 0; font-size: 14.5px; }
.welcome h2 { font-size: 16px; margin: 22px 0 10px; }
.welcome h3 { font-size: 14px; margin: 12px 0 2px; }
.welcome p { margin: 0 0 6px; color: var(--ink-soft); line-height: 1.55; font-size: 13.5px; }
.wl-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.wl-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.wl-grid li b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 3px; }
.wl-foot { display: flex; justify-content: flex-end; margin-top: 20px; position: sticky; bottom: -24px; padding: 12px 0 0; background: var(--panel); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

#app.focus #sidebar, #app.focus #panel { display: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1240px) {
  #panel { width: 280px; }
  .title-input { width: 160px; }
  #btnPdf span, #btnExport span { display: none; }
}
@media (max-width: 900px) {
  #sidebar, #panel { position: absolute; top: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow-lg); }
  #sidebar { left: 0; } #panel { left: 232px; }
  .date-pill input { width: 110px; }
  #saveStatus .txt, #btnTheme2 { display: none; }
  .welcome-card { padding: 22px 20px 18px; }
}
@media (max-width: 700px) {
  #props { bottom: 72px; max-width: calc(100vw - 20px); overflow-x: auto; }
  .tool { width: 38px; height: 38px; }
  #zoombar { bottom: 130px; }
  .owner-chip, .date-pill { display: none; }
}

/* ---------- Bổ sung v3 ---------- */
.top-avatar { width: 34px; height: 34px; border-radius: 50%; padding: 0; flex-shrink: 0; }
.top-avatar .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 14px; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line-strong); }
.top-avatar:hover .avatar { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--accent); }
.theme-pick select { max-width: 140px; }
.set-select { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 9px; padding: 6px 10px; outline: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); margin: 10px 2px 6px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .warn, .sess .tag.warn { color: #C0812E; }
[data-theme="dark"] .legend .warn, [data-theme="dark"] .sess .tag.warn, [data-theme="chalk"] .legend .warn, [data-theme="chalk"] .sess .tag.warn { color: #E9B868; }
.sess { padding-right: 8px; }
.sess > .i { color: var(--muted); flex-shrink: 0; }
.sess.moved { background: color-mix(in srgb, #E9B868 12%, var(--surface)); border-style: dashed; border-left-style: solid; }
.add-link { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--accent-ink); padding: 2px 7px; border-radius: 7px; }
.add-link:hover { background: var(--accent-soft); }
.day-h .add-link { opacity: 1; width: auto; height: auto; }
button.day-empty { display: block; width: 100%; text-align: left; border: 1px dashed var(--line-strong); border-radius: 9px; padding: 7px 10px; font-size: 12px; color: var(--muted); opacity: 1; }
button.day-empty:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.week-nav .wl a { color: var(--accent-ink); font-weight: 600; }
.sec-h { justify-content: flex-start; gap: 6px; }
.info-box { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); color: var(--ink-soft); border-radius: 11px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.info-box .i { margin-top: 2px; color: var(--accent-ink); }
.radio-cards label b { display: flex; align-items: center; gap: 5px; }
@media (max-width: 900px) { .theme-pick select { max-width: 90px; } }
.day-h .add-link { display: inline-flex; opacity: 1; width: auto; height: auto; }
button.day-empty { padding: 5px 10px; }
.top-avatar { margin-left: 2px; }
@media (max-width: 1440px) {
  #btnPdf span, #btnExport span { display: none; }
  .theme-pick select { max-width: 118px; }
  .title-input { width: 180px; }
}

/* ---------- v4: thanh trên gọn, hồ sơ ở góc phải, chế độ màu ở thanh bên ---------- */
.side-theme {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; color: var(--ink-soft);
  font-size: 13px; font-weight: 500; cursor: pointer; background: var(--panel); border: 1px solid var(--line);
}
.side-theme:hover { border-color: var(--line-strong); }
.side-theme span { flex: 1; }
.side-theme select { border: 0; background: none; outline: none; color: var(--accent-ink); font-weight: 600; font-size: 12.5px; cursor: pointer; text-align: right; max-width: 130px; }
.side-theme option { background: var(--panel); color: var(--ink); }
.title-input { flex: 0 1 300px; width: auto; min-width: 110px; }
.top-sep { width: 1px; height: 24px; background: var(--line); margin: 0 2px; }
.top-profile {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 8px 3px 3px; border-radius: 22px; flex-shrink: 0;
  color: var(--ink-soft); font-size: 13px; font-weight: 600; max-width: 150px; border: 1px solid transparent;
}
.top-profile:hover { background: var(--hover); border-color: var(--line); }
.top-profile .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 13px; }
.top-profile .tp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-profile > .i:last-child { color: var(--muted); }
@media (max-width: 1440px) { #btnPdf span, #btnExport span { display: inline; } .title-input { width: auto; } }
@media (max-width: 1320px) { #saveStatus .txt { display: none; } .owner-chip span:last-child { max-width: 70px; } }
@media (max-width: 1180px) { #btnPdf span, #btnExport span, .top-profile .tp-name { display: none; } .top-profile > .i:last-child { display: none; } }
@media (max-width: 900px) { .top-sep { display: none; } }
/* Khi thanh bên đang mở thì đã thấy tên học sinh ở cột giữa: ẩn chip trùng lặp để tên bảng đủ chỗ */
#app:not(.focus) .owner-chip { display: none; }
.side-theme span { white-space: nowrap; flex: 1; }
.side-theme select { max-width: 120px; flex-shrink: 1; min-width: 0; }
@media (max-width: 1440px) { #saveStatus .txt { display: none; } }
@media (max-width: 900px) { #app .owner-chip { display: inline-flex; } }
.side-theme span { display: none; }
.side-theme select { flex: 1; max-width: none; text-align: left; font-size: 13px; }

/* =================== v5: bố cục có thể kéo, thanh trên mới, bộ chọn màu =================== */
#sidebar { width: var(--sbw, 232px); position: relative; transition: width .12s ease; }
#panel { width: var(--pw, 304px); position: relative; }
body.resizing #sidebar { transition: none; }
.resizer { position: absolute; top: 0; bottom: 0; right: -5px; width: 10px; cursor: col-resize; z-index: 46; touch-action: none; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; border-radius: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.resizer:hover::after, .resizer.drag::after { opacity: .9; }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 900px) { #panel { left: var(--sbw, 232px); } }

/* Thu gọn thanh bên thành dải biểu tượng */
#app.rail #sidebar { padding: 14px 8px 10px; }
#app.rail .brand { justify-content: center; padding: 2px 0 14px; }
#app.rail .brand-text, #app.rail .nav-item .name, #app.rail .nav-item .count, #app.rail .side-label span,
#app.rail .side-empty, #app.rail .tbx-h, #app.rail .foot-btn span, #app.rail .lang-seg, #app.rail .foot-row .spacer { display: none; }
#app.rail .nav-item { justify-content: center; padding: 7px 0; }
#app.rail .side-label { justify-content: center; padding: 14px 0 6px; }
#app.rail .theme-box { padding: 6px; }
#app.rail .tbx-row { grid-template-columns: 1fr 1fr; gap: 4px; }
#app.rail .tbx-chip { height: 22px; }
#app.rail .foot-row { flex-direction: column; gap: 4px; }

/* Chân thanh bên */
.side-foot { gap: 8px; }
.theme-box { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 10px; }
.tbx-h { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; gap: 6px; }
.tbx-h span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tbx-h b { color: var(--accent-ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbx-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tbx-chip { height: 30px; border-radius: 9px; padding: 2px; border: 1.5px solid transparent; transition: border-color .12s, transform .12s; }
.tbx-chip:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.tbx-chip.active { border-color: var(--accent); }
.tbx-chip .tp-prev { width: 100%; height: 100%; }
.foot-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 500; }
.foot-btn:hover { background: var(--hover); color: var(--ink); }

/* Ô xem trước chế độ màu */
.tp-prev {
  display: inline-block; flex-shrink: 0; width: 26px; height: 18px; border-radius: 6px; overflow: hidden; position: relative;
  background-color: var(--p);
  background-image: linear-gradient(var(--l) 1px, transparent 1px), linear-gradient(90deg, var(--l) 1px, transparent 1px);
  background-size: 7px 7px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
}
.tp-prev svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tp-split { display: inline-flex; background: none; }
.tp-split > span {
  flex: 1; position: relative; background-color: var(--p);
  background-image: linear-gradient(var(--l) 1px, transparent 1px), linear-gradient(90deg, var(--l) 1px, transparent 1px); background-size: 7px 7px;
}
.tp-split > span svg { width: 200%; }
.tp-split > span:last-child svg { left: -100%; }

/* Bảng chọn chế độ màu */
.theme-pop { width: 340px; padding: 12px; }
.tpop-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 2px 10px; }
.tpop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.popmenu .tpop-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--panel); text-align: left;
}
.popmenu .tpop-card:hover { border-color: var(--line-strong); background: var(--panel); }
.popmenu .tpop-card.active { border-color: var(--accent); background: var(--accent-soft); }
.tpop-card .tp-prev { width: 100%; height: 56px; border-radius: 8px; }
.tpop-l { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink); }
.tpop-l .i { color: var(--accent-ink); }
.tpop-card small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

/* Thanh trên */
#topbar { height: 60px; gap: 10px; padding: 0 14px 0 10px; }
.tb-title { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 0 1 460px; gap: 1px; }
.tb-title .title-input { width: 100%; flex: none; min-width: 0; font-size: 15.5px; padding: 2px 6px; margin-left: -1px; }
.tb-meta { display: flex; align-items: center; gap: 7px; padding-left: 6px; font-size: 12px; color: var(--muted); min-width: 0; white-space: nowrap; }
.meta-owner { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-soft); border-radius: 6px; padding: 1px 4px 1px 1px; min-width: 0; }
.meta-owner:hover { background: var(--hover); color: var(--accent-ink); }
.meta-owner .avatar { width: 16px; height: 16px; border-radius: 50%; font-size: 9px; }
.meta-owner .avatar .i { width: 11px; height: 11px; }
.meta-owner span:last-child { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.meta-date { display: inline-flex; cursor: pointer; border-radius: 6px; }
.meta-date:hover { background: var(--hover); }
.meta-date input { border: 0; background: none; outline: none; color: var(--muted); font-size: 12px; padding: 1px 2px; cursor: pointer; font-variant-numeric: tabular-nums; }
.meta-date input::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; width: 12px; height: 12px; }
.tb-meta .status .txt { display: inline !important; }
.tb-group {
  display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 13px; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--line);
}
.tb-item {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; cursor: pointer; transition: background .12s, color .12s;
}
.tb-item:hover { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.tb-item.tb-icon { padding: 0 8px; }
.tb-select select { appearance: none; -webkit-appearance: none; border: 0; background: none; outline: none; color: inherit; font: inherit; cursor: pointer; }
.tb-select option { background: var(--panel); color: var(--ink); }
.tb-div { width: 1px; height: 18px; background: var(--line-strong); margin: 0 3px; }
#btnThemePick .tp-prev { width: 24px; height: 16px; border-radius: 5px; }
#btnThemePick > .i:last-child { color: var(--muted); }
.top-profile { border: 1px solid var(--line); background: var(--bg); padding: 3px 10px 3px 3px; }
.top-profile:hover { background: var(--surface); }

@media (max-width: 1440px) { #btnThemePick > span:not(.tp-prev) { display: none; } }
@media (max-width: 1240px) { #btnPdf span, #btnExport span { display: none; } .tb-select select { max-width: 80px; } }
@media (max-width: 1080px) { .top-profile .tp-name, .top-profile > .i:last-child { display: none; } .top-profile { padding: 3px; border-radius: 50%; } .tb-meta .status .txt { display: none !important; } }
@media (max-width: 700px) { .tb-meta .meta-dot, .tb-meta .status { display: none; } .tb-group .tb-div { display: none; } }
@media (max-width: 900px) { #sidebar, #panel { position: absolute; top: 0; bottom: 0; z-index: 40; } }
.tp-split > span { overflow: hidden; }
#props { max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
#props::-webkit-scrollbar { display: none; }
@media (max-width: 1180px) { #zoombar { bottom: 132px; } }
.meta-owner { flex-shrink: 0; }
.meta-owner span:last-child { max-width: 120px; }
.meta-date { min-width: 0; flex-shrink: 1; }

/* =================== v6: chọn nền có xem trước, chữ trang trí ở chân thanh bên =================== */
:root, [data-theme="light"] { --pat: rgba(140,105,60,.22); --pat-s: rgba(140,105,60,.42); --pat-m: rgba(196,92,80,.5); }
[data-theme="dark"] { --pat: rgba(230,205,170,.16); --pat-s: rgba(230,205,170,.32); --pat-m: rgba(240,130,110,.55); }
[data-theme="chalk"] { --pat: rgba(235,245,230,.18); --pat-s: rgba(235,245,230,.36); --pat-m: rgba(250,150,130,.6); }
.bgp {
  display: inline-block; flex-shrink: 0; width: 24px; height: 18px; border-radius: 5px; background-color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.bgp-grid { background-image: linear-gradient(var(--pat) 1px, transparent 1px), linear-gradient(90deg, var(--pat) 1px, transparent 1px); background-size: 6px 6px; }
.bgp-oli { background-image: linear-gradient(var(--pat-s) 1px, transparent 1px), linear-gradient(90deg, var(--pat-s) 1px, transparent 1px), linear-gradient(var(--pat) 1px, transparent 1px); background-size: 12px 12px, 12px 12px, 3px 3px; }
.bgp-lines { background-image: linear-gradient(90deg, transparent 7px, var(--pat-m) 7px, var(--pat-m) 8px, transparent 8px), linear-gradient(var(--pat) 1px, transparent 1px); background-size: 100% 100%, 100% 6px; }
.bgp-dots { background-image: radial-gradient(circle, var(--pat-s) 0.9px, transparent 1.3px); background-size: 6px 6px; }
#btnBgPick > .i:last-child { color: var(--muted); }
.bg-pop { width: 300px; padding: 12px; }
.popmenu .bgp-row {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 1.5px solid transparent; margin-bottom: 2px;
}
.popmenu .bgp-row:hover { background: var(--hover); }
.popmenu .bgp-row.active { border-color: var(--accent); background: var(--accent-soft); }
.bgp-row .bgp { width: 62px; height: 42px; border-radius: 8px; }
.bgp-row .bgp-grid { background-size: 9px 9px; }
.bgp-row .bgp-oli { background-size: 16px 16px, 16px 16px, 4px 4px; }
.bgp-row .bgp-lines { background-image: linear-gradient(90deg, transparent 12px, var(--pat-m) 12px, var(--pat-m) 13px, transparent 13px), linear-gradient(var(--pat) 1px, transparent 1px); background-size: 100% 100%, 100% 9px; }
.bgp-row .bgp-dots { background-size: 8px 8px; }
.bgp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bgp-t b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.bgp-t small { font-size: 11.5px; color: var(--muted); }
.bgp-row > .i { color: var(--accent-ink); }
@media (max-width: 1240px) { #btnBgPick .bg-name { display: none; } }


/* =================== v7: thanh bên mới =================== */
#sidebar {
  background:
    radial-gradient(120% 50% at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, var(--accent)) 100%);
  gap: 10px;
}
.brand { padding: 2px 2px 8px 4px; gap: 10px; }
.brand-text { flex: 1; min-width: 0; }
.brand .lang-seg { flex-shrink: 0; padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--panel) 70%, transparent); border: 1px solid var(--line); }
.brand .lang-seg button { padding: 3px 7px; font-size: 11px; font-weight: 700; letter-spacing: .03em; border-radius: 7px; }
.brand .lang-seg button.active { background: var(--accent); color: var(--on-accent); box-shadow: none; }

#studentNav { flex: 1 1 auto; min-height: 90px; }
.side-label { padding: 12px 6px 6px 8px; }
.add-pill { display: inline-flex !important; align-items: center; gap: 3px; width: auto !important; height: 24px; padding: 0 8px 0 6px; border-radius: 8px !important; border: 1px solid var(--line-strong); color: var(--accent-ink) !important; font-size: 11.5px; text-transform: none; letter-spacing: 0; }
.add-pill em { font-style: normal; font-weight: 600; }
.add-pill:hover { background: var(--accent-soft) !important; border-color: var(--accent); }
.nav-item.two { padding: 6px 8px; }
.nav-item.two .avatar { width: 32px; height: 32px; border-radius: 10px; }
.nav-item .name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nav-item .name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .name small { font-size: 11.5px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count { min-width: 22px; height: 20px; border-radius: 10px; background: color-mix(in srgb, var(--panel) 80%, transparent); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.nav-item.active .count { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item.active { position: relative; }
.nav-item.active::before { content: ""; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }

/* Thẻ Lịch hôm nay */
.today-card {
  flex-shrink: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; position: relative; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.today-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent)); }
.tc-h { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.tc-h > div { flex: 1; min-width: 0; line-height: 1.25; }
.tc-h b { display: block; font-size: 13px; }
.tc-h small { font-size: 11.5px; color: var(--muted); }
.tc-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex-shrink: 0; }
.tc-list { display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow-y: auto; }
.tc-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c); }
.tc-item:hover { border-color: var(--line-strong); border-left-color: var(--c); }
.tc-time { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.2; }
.tc-time small { font-weight: 500; color: var(--muted); font-size: 11px; }
.tc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tc-body b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-body small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-badge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--accent); color: var(--on-accent); white-space: nowrap; }
.tc-badge.off { background: var(--line-strong); color: var(--ink-soft); }
.tc-item.done { opacity: .55; }
.tc-item.off { opacity: .55; } .tc-item.off .tc-body small { text-decoration: line-through; }
.tc-item.now { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.tc-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 4px 4px; text-align: center; font-size: 12px; color: var(--muted); }
.tc-empty svg { width: 120px; height: 64px; }

.side-foot { border-top: 0; padding-top: 0; gap: 6px; }
.foot-row { padding: 0 2px; }
#app.rail .today-card, #app.rail .brand .lang-seg, #app.rail .add-pill em, #app.rail .nav-item .name small { display: none; }
#app.rail .add-pill { padding: 0 5px; border: 0; }
#app.rail .nav-item.active::before { left: -6px; }
@media (max-height: 720px) { .today-card { display: none; } }

/* =================== v8: mũi tên chọn, menu học sinh, chọn học sinh khi ghi lịch =================== */
.chev {
  width: 18px; height: 18px; border-radius: 6px; display: inline-grid; place-items: center; flex-shrink: 0;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-soft); transition: transform .18s ease, background .15s, color .15s;
}
.chev .i { stroke-width: 2.4; }
.tb-item:hover .chev, .top-profile:hover .chev { background: var(--accent-soft); color: var(--accent-ink); }
.menu-open .chev { transform: rotate(180deg); background: var(--accent); color: var(--on-accent); }
.tb-item.menu-open, .top-profile.menu-open { background: var(--surface); color: var(--ink); }
#btnBgPick > .i:last-child, #btnThemePick > .i:last-child, .top-profile > .i:last-child { display: none; }
@media (max-width: 1080px) { .top-profile .chev { display: none; } }

button:focus { outline: none; }
button:focus-visible, select:focus-visible, a:focus-visible, [role=button]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Nút ⋯ cho từng học sinh */
.nav-item { position: relative; }
.nav-more {
  width: 26px; height: 26px; border-radius: 8px; display: none; place-items: center; color: var(--ink-soft); flex-shrink: 0;
}
.nav-more:hover { background: var(--surface); color: var(--ink); }
.nav-item:hover .nav-more, .nav-item.menu-open .nav-more { display: grid; }
.nav-item:hover .count, .nav-item.menu-open .count { display: none; }
@media (hover: none) { .nav-item .nav-more { display: grid; } .nav-item .count { display: none; } }
#app.rail .nav-more { display: none !important; }

/* Chọn học sinh khi ghi lịch */
.owner-pick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow-y: auto; padding: 2px; }
.op-item {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 20px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-soft);
}
.op-item input { display: none; }
.op-item .avatar { width: 24px; height: 24px; border-radius: 50%; font-size: 11px; }
.op-item:hover { border-color: var(--accent); }
.op-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* =================== v9: hàng nút chân thanh bên =================== */
.foot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; }
.foot-row .foot-btn {
  justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 11px; font-size: 12.5px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap; min-width: 0;
}
.foot-row .foot-btn span { overflow: hidden; text-overflow: ellipsis; }
.foot-row .foot-btn .i { width: 15px; height: 15px; color: var(--accent-ink); }
.foot-row .foot-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
#app.rail .foot-row { grid-template-columns: 1fr; }
#app.rail .foot-row .foot-btn { padding: 8px 0; }
.foot-row { grid-template-columns: auto 1fr; }
.foot-row .foot-btn { padding: 8px 10px; gap: 5px; font-size: 12.5px; }
.foot-row { grid-template-columns: 1fr; gap: 4px; }
.foot-row .foot-btn { justify-content: flex-start; padding: 8px 10px; gap: 9px; font-size: 13px; }
.foot-row .foot-btn .fb-go { margin-left: auto; font-style: normal; font-size: 16px; line-height: 1; color: var(--muted); transition: transform .15s; }
.foot-row .foot-btn:hover .fb-go { transform: translateX(2px); color: var(--accent-ink); }
#app.rail .foot-row .foot-btn { justify-content: center; }
#app.rail .foot-row .foot-btn span, #app.rail .fb-go { display: none; }

/* =================== v10: bảng Ghi lịch học =================== */
.sess-form .field { margin-bottom: 16px; }
.sess-form .field > label { display: flex; align-items: baseline; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.sess-form .opt { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }

.owner-pick { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; max-height: 168px; overflow-y: auto; padding: 2px; }
.op-item {
  position: relative; display: flex !important; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-soft); min-width: 0;
  transition: border-color .12s, background .12s;
}
.op-item input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.op-item .avatar { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; flex-shrink: 0; }
.op-item > span:not(.avatar) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-check { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); color: transparent; flex-shrink: 0; font-style: normal; }
.op-check .i { stroke-width: 3; }
.op-item:hover { border-color: var(--line-strong); }
.op-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.op-item:has(input:checked) .op-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.kind-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind-cards label {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 13px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); transition: border-color .12s, background .12s;
}
.kind-cards input { position: absolute; opacity: 0; pointer-events: none; }
.kc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg); color: var(--muted); }
.kc-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kc-t b { font-size: 13.5px; color: var(--ink); }
.kc-t small { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.kind-cards label:hover { border-color: var(--line-strong); }
.kind-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.kind-cards label:has(input:checked) .kc-ic { background: var(--accent); color: var(--on-accent); }

.day-pills { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.dp { cursor: pointer; }
.dp input { position: absolute; opacity: 0; pointer-events: none; }
.dp span {
  display: grid; place-items: center; height: 38px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  border: 1.5px solid var(--line); background: var(--surface); transition: all .12s;
}
.dp.we span { color: var(--danger); }
.dp:hover span { border-color: var(--line-strong); }
.dp input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.dp input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.time-row { display: flex; align-items: center; gap: 8px; }
.time-box, .in-ic {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); transition: border-color .12s, box-shadow .12s;
}
.time-box:focus-within, .in-ic:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.time-box input, .in-ic input, .sess-form .in-ic input[type=text] {
  flex: 1; min-width: 0; border: 0 !important; background: none !important; outline: none; padding: 0 !important; box-shadow: none !important;
  font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; height: 100%;
}
.in-ic input[type=text] { font-size: 14px; font-weight: 500; }
.time-box input::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }
[data-theme="dark"] .time-box input::-webkit-calendar-picker-indicator, [data-theme="chalk"] .time-box input::-webkit-calendar-picker-indicator,
[data-theme="dark"] .sess-form input[type=date]::-webkit-calendar-picker-indicator, [data-theme="chalk"] .sess-form input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); }
.time-arrow { color: var(--muted); font-weight: 600; }
.dur-chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.dur-chips button { padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line); }
.dur-chips button:hover { border-color: var(--accent); color: var(--accent-ink); }
.dur-chips button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.sess-form input[type=date] { height: 42px; font-weight: 600; }
@media (max-width: 520px) { .kind-cards { grid-template-columns: 1fr; } .dp span { height: 34px; font-size: 12px; } }
.sess-form .in-ic input[type=text] { font-size: 14px; font-weight: 500; }
.sess-form input::placeholder { font-weight: 400; color: var(--muted); opacity: .8; }

/* =================== v11: bộ chọn giờ =================== */
.time-btn { cursor: pointer; text-align: left; }
.time-btn .tv { flex: 1; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.time-btn:hover { border-color: var(--accent); }
.time-btn.menu-open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.time-pop { width: 236px; padding: 10px; z-index: 130; }
.tp-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tp-big { font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tp-big em { font-style: normal; color: var(--accent); margin: 0 1px; }
.tp-head small { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: center; margin-bottom: 4px; }
.tp-scroll { height: 204px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 2px; scrollbar-width: thin; border-radius: 10px; background: var(--bg); }
.popmenu .tp-scroll button {
  flex-shrink: 0; justify-content: center; height: 34px; padding: 0; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.popmenu .tp-scroll button.dim { color: var(--muted); font-weight: 500; }
.popmenu .tp-scroll button:hover { background: var(--hover); color: var(--ink); }
.popmenu .tp-scroll button.on { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.tp-foot { margin-top: 10px; }
.popmenu .tp-foot .btn { justify-content: center; color: var(--on-accent); }
.popmenu .tp-foot .btn:hover { color: var(--on-accent); background: var(--accent); filter: brightness(.93); }

/* =================== v12: bỏ số đếm, bộ chọn giờ trau chuốt hơn =================== */
.nav-item .count { display: none !important; }
.nav-item:hover .nav-more, .nav-item.menu-open .nav-more { display: grid; }

.time-pop { width: 264px; padding: 0; overflow: hidden; border-radius: 16px; }
.tp-head {
  margin: 0; padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 30%, transparent));
}
.tp-big { font-size: 30px; }
.tp-cols { padding: 10px 10px 0; gap: 10px; position: relative; }
.tp-scroll {
  height: 196px; background: transparent; padding: 78px 2px; scroll-snap-type: y mandatory; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30%, #000 70%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 30%, #000 70%, transparent 100%);
}
.tp-scroll::-webkit-scrollbar { display: none; }
.popmenu .tp-scroll button { scroll-snap-align: center; height: 38px; font-size: 16px; border-radius: 10px; }
.popmenu .tp-scroll button.on { font-size: 17px; }
.tp-cols::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: calc(10px + 18px + 98px - 20px); height: 40px; pointer-events: none;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tp-foot { margin: 0; padding: 10px; border-top: 1px solid var(--line); }
.tp-scroll { position: relative; }

/* =================== v13: trạng thái bấm / rê chuột rõ ràng =================== */
/* Không để lại viền sau khi bấm chuột; chỉ hiện viền khi dùng bàn phím */
.tb-item:focus, .top-profile:focus { outline: none; }
.tb-item:focus-visible, .top-profile:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }

/* Rê chuột qua từng nút trong khối thanh trên */
.tb-item { position: relative; transition: background .15s, color .15s, transform .15s; }
.tb-item:hover { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.tb-item:hover .i { color: var(--accent-ink); }
.tb-item:active { transform: scale(.97); }
.tb-item.menu-open { background: var(--accent-soft); color: var(--accent-ink); }
.top-profile:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.top-profile.menu-open { border-color: var(--accent); }

/* Mũi tên: xuống khi đóng, lên khi mở */
.chev { transition: transform .2s ease, background .15s, color .15s; }
.tb-item:hover .chev, .top-profile:hover .chev { background: var(--accent); color: var(--on-accent); }
.menu-open .chev { transform: rotate(180deg); background: var(--accent); color: var(--on-accent); }

/* Rê chuột qua từng dòng / thẻ trong bảng chọn */
.popmenu button { transition: background .12s, color .12s, border-color .12s, transform .12s; }
.popmenu > button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.popmenu > button:hover .i { color: var(--accent-ink); }
.popmenu > button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.popmenu > button.danger:hover .i { color: var(--danger); }
.popmenu .bgp-row:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateX(2px); }
.popmenu .bgp-row:hover .bgp-t b { color: var(--accent-ink); }
.popmenu .tpop-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.popmenu .tpop-card:hover .tpop-l { color: var(--accent-ink); }

/* =================== v14: Trợ lý AI, lời chúc mỗi ngày, ghi chú AI =================== */
/* ---- Hiệu ứng chờ ---- */
.shimmer { display: block; height: 10px; border-radius: 6px; margin: 6px 0; background: linear-gradient(90deg, var(--line) 0%, var(--line-strong) 50%, var(--line) 100%); background-size: 200% 100%; animation: shim 1.2s linear infinite; }
.shimmer.short { width: 60%; }
@keyframes shim { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spin .i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Thanh bên: bố cục mới ---- */
#studentNav { flex: 0 1 auto; min-height: 60px; }
.ai-note {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px;
  margin: 4px 0; padding: 12px; border-radius: 14px; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    color-mix(in srgb, var(--panel) 75%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
}
.an-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.an-h img { border-radius: 8px; flex-shrink: 0; }
.an-h span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-chip { display: inline-flex; align-items: center; gap: 3px; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 6px; border-radius: 8px; background: var(--accent); color: var(--on-accent); }
.an-body { overflow: hidden; }
.an-body b { display: block; font-size: 14px; line-height: 1.35; color: var(--ink); margin-bottom: 4px; font-family: "Be Vietnam Pro", var(--font); }
.an-body p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.an-ask { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--accent-ink); padding: 4px 8px; margin-left: -8px; border-radius: 8px; }
.an-ask span { display: inline-block; transition: transform .15s; }
.an-ask:hover { background: var(--accent-soft); } .an-ask:hover span { transform: translateX(3px); }

.day-card { padding: 12px; }
.dc-top { display: flex; align-items: center; gap: 9px; }
.dc-top > div { flex: 1; min-width: 0; line-height: 1.25; }
.dc-top b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-top small { font-size: 11.5px; color: var(--muted); }
.dc-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.dc-morning { background: linear-gradient(135deg, #F2B661, #E08A3C); }
.dc-noon { background: linear-gradient(135deg, #F0C25C, #D9963A); }
.dc-afternoon { background: linear-gradient(135deg, #E59866, #C0663F); }
.dc-evening { background: linear-gradient(135deg, #7C79B8, #4F4C8A); }
.dc-msg { margin: 10px 0 0; font-size: 12.8px; line-height: 1.6; color: var(--ink-soft); }
.dc-sec { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dc-sec .add-link { text-transform: none; letter-spacing: 0; }
.dc-free { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 2px 2px 0; }
.day-card .tc-list { max-height: 150px; }
#app.rail .ai-note, #app.rail .day-card { display: none; }
@media (max-height: 760px) { .ai-note { display: none; } }
@media (max-height: 640px) { .day-card { display: none; } }

/* ---- Nút chú chó ---- */
.ai-fab {
  position: absolute; right: 18px; bottom: 74px; z-index: 12; width: 60px; height: 60px; border-radius: 20px; padding: 0;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(80, 50, 20, .22), 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  transition: transform .2s ease, box-shadow .2s, opacity .2s;
}
.ai-fab img { width: 100%; height: 100%; border-radius: 19px; display: block; }
.ai-fab:hover { transform: translateY(-3px) rotate(-4deg); box-shadow: 0 12px 30px rgba(80, 50, 20, .3), 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.ai-fab::after { content: ""; position: absolute; inset: -4px; border-radius: 24px; border: 2px solid var(--accent); opacity: 0; animation: fabPulse 3s ease-out infinite; }
@keyframes fabPulse { 0% { opacity: .5; transform: scale(.95); } 70%, 100% { opacity: 0; transform: scale(1.18); } }
.ai-fab-badge { position: absolute; right: -6px; top: -6px; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 9px; background: var(--accent); color: var(--on-accent); border: 2px solid var(--panel); }
.ai-fab.hide { opacity: 0; pointer-events: none; transform: scale(.8); }
@media (max-width: 1180px) { .ai-fab { bottom: 188px; } }

/* ---- Khung trò chuyện ---- */
.ai-panel {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(400px, calc(100% - 24px)); z-index: 30;
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s;
}
.ai-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.ai-h {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 25%, var(--panel)));
}
.ai-h img { border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.ai-h-t { flex: 1; min-width: 0; line-height: 1.3; }
.ai-h-t b { display: block; font-size: 14.5px; }
.ai-h-t small { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.ai-h-t .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.ai-h-t .dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.ai-ctx { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.ctx-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); padding: 3px 8px 3px 4px; border-radius: 10px; background: var(--bg); }
.ctx-chip .avatar { width: 18px; height: 18px; border-radius: 6px; font-size: 9px; }
.ctx-chip > .i { margin-left: 3px; color: var(--accent-ink); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-setup { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-soft); font-size: 12.5px; line-height: 1.55; }
.ai-setup .i { color: var(--accent-ink); margin-top: 2px; }
.ai-setup code { background: var(--surface); }
.ai-hello { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 8px 4px; }
.ai-hello img { border-radius: 18px; box-shadow: 0 6px 18px rgba(80,50,20,.18); margin-bottom: 4px; }
.ai-hello b { font-size: 15px; }
.ai-hello span { font-size: 12.8px; color: var(--muted); line-height: 1.55; }
.ai-sugs { display: flex; flex-direction: column; gap: 6px; }
.ai-sug { display: flex; align-items: flex-start; gap: 8px; text-align: left; padding: 9px 11px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 12.8px; color: var(--ink-soft); line-height: 1.45; transition: border-color .12s, background .12s, transform .12s; }
.ai-sug .i { color: var(--accent-ink); margin-top: 2px; }
.ai-sug:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); transform: translateX(2px); }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.me { justify-content: flex-end; }
.msg img { border-radius: 9px; flex-shrink: 0; }
.bubble { max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: 13.3px; line-height: 1.6; overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; }
.msg.bot .bubble { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 5px; }
.msg.err .bubble { background: var(--danger-soft); border-color: transparent; color: var(--ink-soft); }
.bubble p { margin: 0 0 6px; } .bubble p:last-child { margin-bottom: 0; }
.bubble h4 { margin: 8px 0 4px; font-size: 13.5px; color: var(--accent-ink); }
.bubble ul, .bubble ol { margin: 4px 0 6px; padding-left: 20px; }
.bubble li { margin: 2px 0; }
.bubble code { font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.msg-acts { display: flex; gap: 4px; margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.msg-acts button { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 3px 7px; border-radius: 7px; }
.msg-acts button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.ai-input textarea {
  flex: 1; resize: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 14px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.45; outline: none; max-height: 140px; color: var(--ink);
}
.ai-input textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-send { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex-shrink: 0; transition: transform .12s, filter .12s; }
.ai-send:hover { filter: brightness(.93); transform: translateY(-1px); }
.dc-top b { white-space: normal; line-height: 1.3; }
.dc-top .dc-name { color: var(--accent-ink); }
.dc-sec span, .dc-sec .add-link { white-space: nowrap; }
.dc-sec em { font-style: normal; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; }
.ai-input textarea { min-height: 42px; white-space: pre-wrap; }
.ai-input textarea::placeholder { color: var(--muted); }
.an-h span { font-size: 12px; }
.dc-top { position: relative; padding-right: 28px; }
.dc-top .dc-refresh { position: absolute; right: -4px; top: -4px; }
.dc-top b { font-size: 13.5px; }
.an-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none !important; }
.ai-note { justify-content: flex-start; overflow-y: auto; scrollbar-width: none; }
.ai-note::-webkit-scrollbar { display: none; }
.an-body p { -webkit-line-clamp: unset; display: block; }
.an-h .ai-chip { padding: 3px; border-radius: 7px; } .an-h { gap: 6px; }

/* =================== v15: học phí, cửa sổ chào, hướng dẫn người mới, thanh bên gọn =================== */
/* Logo bấm được */
.logo-btn { padding: 0; border-radius: 12px; flex-shrink: 0; transition: transform .15s; }
.logo-btn:hover { transform: rotate(-6deg) scale(1.05); }
.logo-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tiêu đề "Học sinh" dính trên, chỉ danh sách cuộn */
#studentNav { position: relative; flex: 1 1 auto; }
#studentNav .side-label {
  position: sticky; top: 0; z-index: 3; margin: 0 -4px; padding: 10px 10px 8px 12px;
  background: var(--bg); box-shadow: 0 6px 8px -8px rgba(0,0,0,.25);
}

/* 5 thẻ trong cột học sinh */
.tabs { gap: 2px; padding: 0 8px 10px; }
.tab { font-size: 12px; gap: 4px; padding: 7px 2px; }
.tab .i { width: 14px; height: 14px; }
@media (max-width: 1240px) { .tab .i { display: none; } }

/* Học phí */
.fee-rate { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.fee-rate label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.fee-rate label .i { color: var(--accent-ink); }
.fee-in { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; background: var(--paper); }
.fee-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fee-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 9px 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.fee-in span { font-weight: 700; color: var(--muted); }
.fee-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.fee-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fee-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.fee-stats small { font-size: 11px; color: var(--muted); line-height: 1.25; }
.adj-ctl { display: inline-flex; align-items: center; gap: 6px; }
.adj-ctl button { width: 22px; height: 22px; border-radius: 7px; background: var(--bg); color: var(--ink-soft); font-weight: 700; display: grid; place-items: center; }
.adj-ctl button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.fee-total {
  border-radius: 16px; padding: 14px; margin-bottom: 8px; color: var(--on-accent); position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #5a2f12));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.fee-total::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.1); }
.fee-total.paid { background: linear-gradient(135deg, #5E8B5A, #3f6a3b); box-shadow: 0 6px 18px rgba(80,130,80,.3); }
.fee-total small { font-size: 11.5px; opacity: .85; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ft-amt { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0; font-variant-numeric: tabular-nums; }
.ft-formula { font-size: 13px; font-weight: 600; opacity: .95; }
.ft-proj { font-size: 12px; opacity: .8; margin-top: 2px; }
.ft-paid { margin-top: 10px; padding: 0; }
.ft-paid .lbl { color: inherit; font-size: 13px; }
.ft-paid .knob { background: rgba(255,255,255,.35); }
.ft-paid input:checked + .knob { background: rgba(255,255,255,.9); }
.ft-paid input:checked + .knob::after { background: #3f6a3b; }
.fee-list { display: flex; flex-direction: column; gap: 3px; }
.fee-row { display: grid; grid-template-columns: 64px 84px 1fr auto; align-items: center; gap: 6px; font-size: 12.5px; padding: 6px 8px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.fee-row .fr-d { font-weight: 600; }
.fee-row .fr-t { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.fee-row .fr-s { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fee-row em { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 8px; background: var(--bg); color: var(--muted); }
.fee-row.done em { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.fee-row.off { opacity: .55; } .fee-row.off .fr-s { text-decoration: line-through; }
.fee-sum { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.fs-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 11px; text-align: left; border: 1px solid transparent; }
.fs-row:hover { background: var(--hover); }
.fs-row.cur { background: var(--surface); border-color: var(--line-strong); }
.fs-row .avatar { width: 28px; height: 28px; font-size: 12px; }
.fs-n { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; display: flex; flex-direction: column; }
.fs-n small { font-weight: 400; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-a { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.fs-a b { font-size: 13px; font-variant-numeric: tabular-nums; }
.fs-a em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--danger); }
.fs-a em.ok { color: var(--ok); }
.fs-total { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 10px 10px 8px; margin-top: 4px; border-top: 1.5px dashed var(--line-strong); }
.fs-total span { font-weight: 700; }
.fs-total b { font-size: 16px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.fs-total small { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

/* Hướng dẫn 3 bước */
.wl-onboard { margin-top: 22px; padding: 16px; border-radius: 16px; background: var(--accent-soft); }
.wl-onboard h2 { margin: 0 0 4px !important; }
.wl-onboard p { margin-bottom: 12px !important; }
.ob-steps { display: flex; flex-direction: column; gap: 6px; }
.ob-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: left; transition: border-color .12s, transform .12s; }
.ob-step:hover { border-color: var(--accent); transform: translateX(2px); }
.ob-step > .i { color: var(--accent-ink); }
.ob-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--accent); color: var(--on-accent); flex-shrink: 0; }
.ob-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ob-t b { font-size: 13.5px; }
.ob-t small { font-size: 12px; color: var(--muted); }
.ob-step.done { opacity: .7; }
.ob-step.done .ob-n { background: var(--ok); }
.ob-step.done .ob-t b { text-decoration: line-through; text-decoration-color: var(--muted); }

/* Cửa sổ chào */
.greet-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg);
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: hidden; display: flex; flex-direction: column; animation: pop .25s ease;
}
.gr-hero { position: relative; padding: 22px 24px 18px; color: #4A3A2C; overflow: hidden; --hx: rgba(255,255,255,.55); --hx2: rgba(255,255,255,.35); --hic: #9A6A44; border-bottom: 1px solid rgba(140,105,70,.12); }
.gr-hero::before { content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: var(--hx2); }
.gr-hero::after { content: ""; position: absolute; right: 70px; bottom: -80px; width: 150px; height: 150px; border-radius: 50%; background: var(--hx2); opacity: .7; }
.gr-morning { background: linear-gradient(140deg, #FBF7F1 0%, #F2E7D8 55%, #EADBC6 100%); }
.gr-noon { background: linear-gradient(140deg, #FAF5EE 0%, #EFE3D2 60%, #E6D5BF 100%); }
.gr-afternoon { background: linear-gradient(140deg, #F8F0E8 0%, #EEDDCD 55%, #E3CCB8 100%); --hic: #A0634A; }
.gr-evening { background: linear-gradient(140deg, #F4EEEB 0%, #E7DAD4 55%, #D9C7BF 100%); --hic: #8A6270; }
.gr-night { background: linear-gradient(140deg, #EDE7E0 0%, #DDD2C6 55%, #CDBFB0 100%); --hic: #6B5A7A; }
[data-theme="dark"] .gr-hero, [data-theme="chalk"] .gr-hero { color: #F1E6D8; --hx: rgba(255,240,220,.1); --hx2: rgba(255,240,220,.06); --hic: #E2B98F; border-bottom-color: rgba(255,240,220,.08); }
[data-theme="dark"] .gr-morning, [data-theme="dark"] .gr-noon, [data-theme="chalk"] .gr-morning, [data-theme="chalk"] .gr-noon { background: linear-gradient(140deg, #3E352C, #2E2721); }
[data-theme="dark"] .gr-afternoon, [data-theme="chalk"] .gr-afternoon { background: linear-gradient(140deg, #40342C, #2F2621); }
[data-theme="dark"] .gr-evening, [data-theme="dark"] .gr-night, [data-theme="chalk"] .gr-evening, [data-theme="chalk"] .gr-night { background: linear-gradient(140deg, #3A3230, #28221F); }
.gr-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--hx); color: var(--hic); box-shadow: 0 2px 10px rgba(120,85,50,.08); position: relative; z-index: 1; }
.gr-ht { position: relative; z-index: 1; margin-top: 12px; }
.gr-ht small { font-size: 12.5px; opacity: .7; font-weight: 600; }
.gr-ht h2 { margin: 2px 0 0; font-size: 26px; letter-spacing: -.4px; line-height: 1.2; }
.gr-x { position: absolute; right: 12px; top: 12px; color: inherit; z-index: 2; opacity: .7; }
.gr-x:hover { background: var(--hx); color: inherit; opacity: 1; }
.gr-msg { position: relative; z-index: 1; margin: 10px 0 0; font-size: 14.5px; line-height: 1.65; }
.gr-msg .shimmer { background: linear-gradient(90deg, var(--hx2), var(--hx), var(--hx2)); background-size: 200% 100%; }
.gr-chips, .dc-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.gr-chips { margin-top: 12px; }
.gr-chips span, .dc-chips span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 20px; background: var(--hx); border: 1px solid rgba(140,105,70,.14); white-space: nowrap; }
[data-theme="dark"] .gr-chips span, [data-theme="chalk"] .gr-chips span { border-color: rgba(255,240,220,.1); }
.dc-chips { margin: 8px 0 2px; }
.dc-chips span { --hx: var(--accent-soft); font-size: 11.5px; padding: 3px 9px; border-color: transparent; color: var(--ink-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gr-wx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gr-wd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; transition: transform .15s, border-color .15s; }
.gr-wd:hover { transform: translateY(-2px); border-color: var(--accent); }
.gr-wd.today { background: var(--accent-soft); border-color: transparent; }
.gr-wd small { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.gr-wd .e { font-size: 24px; line-height: 1.3; }
.gr-wd b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.gr-wd em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.gr-city-n { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--accent-ink); cursor: pointer; }
.gr-city-n:hover { text-decoration: underline; }
.gr-city { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent-ink); padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--line); width: 100%; }
.gr-city:hover { background: var(--accent-soft); }
.gr-body { padding: 16px 20px 6px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.gr-sec h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.gr-sec h3 .i { color: var(--accent-ink); }
.gr-sec h3 em { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; }
.gr-lessons { display: flex; flex-direction: column; gap: 5px; }
.gr-les { display: grid; grid-template-columns: 96px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); }
.gr-les b { grid-row: 1 / 3; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.gr-les span { font-weight: 600; font-size: 13.5px; }
.gr-les small { grid-column: 2; font-size: 12px; color: var(--muted); }
.gr-les i { grid-column: 3; grid-row: 1 / 3; font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; background: var(--accent); color: var(--on-accent); }
.gr-les i.dn { background: var(--bg); color: var(--muted); }
.gr-les.done, .gr-les.off { opacity: .6; }
.gr-free { margin: 0; font-size: 13px; color: var(--muted); }
.gr-note { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; }
.gr-note b { display: block; font-size: 15px; margin-bottom: 3px; }
.gr-note p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.gr-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
@media (max-width: 560px) { .gr-ht h2 { font-size: 22px; } .gr-les { grid-template-columns: 82px 1fr auto; } }
.tab .i { display: none; } .tab { font-size: 12.5px; }

/* ===== v16: trò chuyện trong cửa sổ chào + vị trí ===== */
.gr-chat { display: flex; flex-direction: column; gap: 10px; }
.gc-thread { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; padding: 2px 2px 4px; scroll-behavior: smooth; }
.gc-group { display: flex; gap: 8px; align-items: flex-end; }
.gc-av { width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; background: var(--accent-soft); box-shadow: 0 1px 4px rgba(120,85,50,.15); }
.gc-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-bubbles { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; max-width: 86%; }
.gc-b { margin: 0; padding: 8px 13px; font-size: 14px; line-height: 1.55; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); animation: gcIn .35s ease both; }
.gc-group .gc-b { border-radius: 6px 18px 18px 6px; }
.gc-group .gc-b:first-child { border-top-left-radius: 18px; }
.gc-group .gc-b:last-child { border-bottom-left-radius: 18px; }
.gc-bubbles .gc-b:nth-child(2) { animation-delay: .08s } .gc-bubbles .gc-b:nth-child(3) { animation-delay: .16s } .gc-bubbles .gc-b:nth-child(4) { animation-delay: .24s } .gc-bubbles .gc-b:nth-child(5) { animation-delay: .32s } .gc-bubbles .gc-b:nth-child(6) { animation-delay: .4s }
.gc-me { display: flex; justify-content: flex-end; }
.gc-me .gc-b { max-width: 80%; background: var(--accent); border-color: transparent; color: var(--on-accent); border-radius: 18px 18px 6px 18px; }
@keyframes gcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.gc-b.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.gc-b.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: gcDot 1.2s infinite ease-in-out; }
.gc-b.typing i:nth-child(2) { animation-delay: .15s } .gc-b.typing i:nth-child(3) { animation-delay: .3s }
@keyframes gcDot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.gc-quick { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 38px; }
.gc-quick button { font-size: 12.5px; padding: 5px 11px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); transition: background .15s, border-color .15s, color .15s; }
.gc-quick button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.gc-form { display: flex; gap: 6px; align-items: center; padding: 4px 4px 4px 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.gc-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gc-form input { flex: 1; border: 0; background: none; outline: none; font: inherit; font-size: 14px; color: var(--ink); padding: 6px 0; min-width: 0; }
.gc-send { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: none; transition: filter .15s, transform .15s; }
.gc-send:hover { filter: brightness(1.06); transform: scale(1.05); }
.gc-send:disabled { opacity: .5; transform: none; }
.gr-city-n small { margin-left: 6px; font-weight: 500; color: var(--muted); font-size: 11px; }
.gr-loc { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; transition: filter .15s; }
.gr-loc:hover { filter: brightness(.96); }
.gr-loc.spin .i { animation: spin 1s linear infinite; }
.gr-loc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.gr-noloc { display: flex; gap: 8px; flex-wrap: wrap; }
.gr-noloc .gr-city { width: auto; }
.chip-day { background: var(--hx); }
.gr-hero, .gr-foot { flex: none; }
.fee-stats .taught i { font-style: normal; font-size: 10.5px; color: var(--accent-ink); line-height: 1.2; }
.gr-noloc { align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* ===== v17: lời nhắn AI trong cửa sổ chào ===== */
.gr-letter { position: relative; padding: 14px 16px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 2px 12px rgba(120,85,50,.06); }
.gr-letter::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); opacity: .55; }
.gl-from { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gl-from b { font-size: 13px; }
.gl-from small { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gr-letter p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.7; color: var(--ink); animation: gcIn .4s ease both; }
.gr-letter p:nth-of-type(2) { animation-delay: .1s } .gr-letter p:nth-of-type(3) { animation-delay: .2s }
.gr-letter p:last-child { margin-bottom: 0; }
.gr-letter .gl-wait { font-size: 13px; color: var(--muted); }
.gr-letter .shimmer { display: block; margin: 6px 0; }

/* ===== v18: thẻ Thành tiền tông be ===== */
.fee-total { color: #4A3A2C; background: linear-gradient(140deg, #FBF6EF 0%, #F1E5D5 55%, #E8D7C1 100%); border: 1px solid rgba(140,105,70,.16); box-shadow: 0 6px 18px rgba(140,105,70,.12); }
.fee-total::after { background: rgba(255,255,255,.5); }
.fee-total::before { content: ""; position: absolute; left: -24px; bottom: -40px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.35); }
.fee-total > * { position: relative; z-index: 1; }
.fee-total small { color: #9A6A44; opacity: 1; }
.ft-amt { color: #5A3E26; }
.ft-formula { color: #6B5340; }
.ft-proj { color: #8A7462; opacity: 1; }
.ft-paid .knob { background: rgba(140,105,70,.25); }
.ft-paid input:checked + .knob { background: #7FA272; }
.ft-paid input:checked + .knob::after { background: #fff; }
.fee-total.paid { color: #36502F; background: linear-gradient(140deg, #F4F6EE 0%, #E4EBD8 60%, #D5E0C5 100%); border-color: rgba(95,130,85,.2); box-shadow: 0 6px 18px rgba(95,130,85,.14); }
.fee-total.paid small, .fee-total.paid .ft-amt { color: #4C6E44; }
[data-theme="dark"] .fee-total, [data-theme="chalk"] .fee-total { color: #F1E6D8; background: linear-gradient(140deg, #3E352C, #2E2721); border-color: rgba(255,240,220,.08); }
[data-theme="dark"] .fee-total::after, [data-theme="dark"] .fee-total::before, [data-theme="chalk"] .fee-total::after, [data-theme="chalk"] .fee-total::before { background: rgba(255,240,220,.06); }
[data-theme="dark"] .fee-total small, [data-theme="chalk"] .fee-total small { color: #E2B98F; }
[data-theme="dark"] .ft-amt, [data-theme="dark"] .ft-formula, [data-theme="chalk"] .ft-amt, [data-theme="chalk"] .ft-formula { color: #F6EBDD; }
[data-theme="dark"] .ft-proj, [data-theme="chalk"] .ft-proj { color: #C9B8A6; }
[data-theme="dark"] .fee-total.paid, [data-theme="chalk"] .fee-total.paid { background: linear-gradient(140deg, #34402F, #263022); }
.fee-stats > div { justify-content: center; }

/* ===== v19: nhắc lịch & thông báo ===== */
.dc-acts { display: inline-flex; align-items: center; gap: 2px; }
.dc-acts .icon-btn { width: 26px; height: 26px; color: var(--muted); }
.dc-acts .icon-btn:hover { color: var(--accent-ink); background: var(--accent-soft); }
.rem-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: linear-gradient(140deg, #FBF6EF, #F1E5D5); border: 1px solid rgba(140,105,70,.16); margin-bottom: 12px; color: #4A3A2C; }
.rem-status.ok { background: linear-gradient(140deg, #F4F6EE, #E4EBD8); border-color: rgba(95,130,85,.2); color: #36502F; }
.rem-status .rs-ic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.7); color: #9A6A44; }
.rem-status.ok .rs-ic { color: #4C6E44; }
.rem-status b { display: block; font-size: 14px; }
.rem-status small { display: block; font-size: 12.5px; line-height: 1.5; opacity: .85; margin-top: 2px; }
[data-theme="dark"] .rem-status, [data-theme="chalk"] .rem-status { background: linear-gradient(140deg, #3E352C, #2E2721); color: #F1E6D8; border-color: rgba(255,240,220,.08); }
[data-theme="dark"] .rem-status.ok, [data-theme="chalk"] .rem-status.ok { background: linear-gradient(140deg, #34402F, #263022); color: #E3EEDB; }
[data-theme="dark"] .rem-status .rs-ic, [data-theme="chalk"] .rem-status .rs-ic { background: rgba(255,240,220,.08); color: #E2B98F; }
.rem-steps { margin: 0 0 14px; padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
.rem-steps li { margin-bottom: 4px; }
.rem-steps .btn { display: inline-flex; vertical-align: middle; margin-right: 4px; }
.rem-steps code { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.rem-row { margin: 4px 0 12px; }
.rem-block { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: opacity .15s; }
.rem-block.dim { opacity: .45; pointer-events: none; }
.rem-lab { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.rem-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rem-chips button { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); transition: background .15s, border-color .15s, color .15s; }
.rem-chips button:hover { border-color: var(--accent); color: var(--accent-ink); }
.rem-chips button.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.rem-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); }
.rem-line .switch { margin: 0; }
.rem-line input[type=time] { font: inherit; font-size: 13.5px; padding: 5px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-variant-numeric: tabular-nums; }
.rem-line input[type=time]:disabled { opacity: .45; }
.rem-block .hint { margin: 8px 0 0; }
.rem-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dc-sec { gap: 4px; } .dc-sec > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; } .dc-acts { flex: none; } .dc-acts .add-link { padding-left: 2px; padding-right: 2px; }

/* ===== v20: chữ gợi ý chạy chậm + học phí cộng dồn ===== */
.mq-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden; }
.mq-wrap input { width: 100%; }
.mq-ph { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; color: var(--muted); white-space: nowrap; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.mq-ph > span { display: inline-block; will-change: transform; }
.mq-wrap.run .mq-ph > span { animation: mqRun var(--mq-t, 8s) ease-in-out infinite alternate; }
.mq-wrap.run .mq-ph { -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 92%, transparent); }
@keyframes mqRun { 0%, 12% { transform: translateX(0); } 88%, 100% { transform: translateX(var(--mq, 0)); } }
.mq-wrap input:not(:placeholder-shown) + .mq-ph { display: none; }
@media (prefers-reduced-motion: reduce) { .mq-wrap.run .mq-ph > span { animation: none; } }

.fee-stats { grid-template-columns: 1fr 1fr !important; }
.fee-stats .adj-ctl button:disabled { opacity: .35; cursor: default; }
.ft-carry { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(140,105,70,.28); }
.ftc-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 700; color: #9A6A44; margin-bottom: 6px; }
.ftc-h b { font-size: 15px; color: #8A4E2A; }
.ftc-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 5px 8px; margin: 0 -8px; border-radius: 10px; font-size: 13px; transition: background .15s; }
.ftc-row:hover { background: rgba(255,255,255,.45); }
.ftc-row small { color: #8A7462; font-size: 11.5px; margin-left: 4px; }
.ftc-row b { font-variant-numeric: tabular-nums; }
.ftc-row button, .ft-due button { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 14px; background: rgba(255,255,255,.7); color: #6B4A2E; border: 1px solid rgba(140,105,70,.18); transition: background .15s, color .15s; }
.ftc-row button:hover, .ft-due button:hover { background: #7FA272; color: #fff; border-color: transparent; }
.ft-due { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.6); border: 1px solid rgba(140,105,70,.16); }
.ft-due span { font-size: 12.5px; font-weight: 700; color: #9A6A44; text-transform: uppercase; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 6px; }
.ft-due b { margin-left: auto; font-size: 19px; color: #8A4E2A; font-variant-numeric: tabular-nums; }
.ft-due.ok span { color: #4C6E44; text-transform: none; letter-spacing: 0; font-size: 13px; }
[data-theme="dark"] .ftc-h, [data-theme="dark"] .ft-due span, [data-theme="chalk"] .ftc-h, [data-theme="chalk"] .ft-due span { color: #E2B98F; }
[data-theme="dark"] .ftc-h b, [data-theme="dark"] .ft-due b, [data-theme="chalk"] .ftc-h b, [data-theme="chalk"] .ft-due b { color: #F6D8B8; }
[data-theme="dark"] .ft-due, [data-theme="dark"] .ftc-row button, [data-theme="dark"] .ft-due button, [data-theme="chalk"] .ft-due, [data-theme="chalk"] .ftc-row button, [data-theme="chalk"] .ft-due button { background: rgba(255,240,220,.06); border-color: rgba(255,240,220,.1); color: #F1E6D8; }
[data-theme="dark"] .ftc-row small, [data-theme="chalk"] .ftc-row small { color: #C9B8A6; }
.ft-due { flex-wrap: wrap; row-gap: 4px; }
.ft-due span { flex-basis: 100%; }
.ft-due b { margin-left: 0; white-space: nowrap; }
.ft-due button { margin-left: auto; white-space: nowrap; }
.ft-due.ok span { flex-basis: auto; }
.ftc-row small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ftc-row b, .ftc-h b { white-space: nowrap; }

/* ===== v21: Done nhỏ, học phí 2 ô, tuỳ chọn PDF ===== */
.tc-done { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 2px 6px; border-radius: 8px; color: #5E8155; background: rgba(127,162,114,.14); white-space: nowrap; }
.tc-item.done .tc-body b, .tc-item.done .tc-time { opacity: .6; }
.gr-les i.done { display: inline-flex; align-items: center; gap: 2px; align-self: center; font-size: 10px; padding: 2px 7px; color: #5E8155; background: rgba(127,162,114,.14); }
[data-theme="dark"] .tc-done, [data-theme="dark"] .gr-les i.done, [data-theme="chalk"] .tc-done, [data-theme="chalk"] .gr-les i.done { color: #A9C99D; background: rgba(127,162,114,.16); }
.fee-stats .plan b { font-size: 22px; line-height: 30px; }
.fee-stats .plan { justify-content: center; }

.opt-seg { display: grid; gap: 8px; }
.opt-seg.c3 { grid-template-columns: repeat(3, 1fr); }
.opt-seg.c2 { grid-template-columns: repeat(2, 1fr); }
.opt-seg label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.opt-seg label:hover { border-color: var(--accent); transform: translateY(-1px); }
.opt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.opt-seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.opt-seg label:has(input:checked)::after { content: ""; position: absolute; top: 7px; right: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 9px no-repeat; }
.opt-seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-seg b { font-size: 13px; color: var(--ink); }
.opt-seg small { font-size: 11px; color: var(--muted); }
.og-ic { position: relative; height: 34px; width: 44px; display: grid; place-items: center; margin-bottom: 2px; }
.og-ic i { display: block; border: 1.8px solid var(--accent-ink); border-radius: 3px; background: var(--panel); }
.pg-p i { width: 20px; height: 28px; }
.pg-l i { width: 28px; height: 20px; }
.pg-auto i { width: 26px; height: 24px; border-style: dashed; }
.pg-auto::after { content: "✦"; position: absolute; right: 4px; top: 0; font-size: 11px; color: var(--accent); }
.pg-one i { width: 22px; height: 28px; background: repeating-linear-gradient(180deg, var(--panel) 0 4px, color-mix(in srgb, var(--accent-ink) 25%, transparent) 4px 5px); }
.pg-many i { position: absolute; width: 20px; height: 26px; }
.pg-many i:first-child { transform: translate(-5px, -3px); opacity: .55; }
.pg-many i:last-child { transform: translate(4px, 3px); }
.opt-seg label:has(input:checked) .og-ic i { border-color: var(--accent); }
.tb-meta .status:empty, .tb-meta .meta-dot:has(+ .status:empty) { display: none; }

/* ===== v22: tổng thu nhập, bảng tự xoá ===== */
.inc-btn { display: flex !important; align-items: center; gap: 10px; padding: 9px 12px !important; text-align: left; border-radius: 14px; background: linear-gradient(140deg, #FBF6EF, #F1E5D5) !important; border: 1px solid rgba(140,105,70,.16) !important; color: #4A3A2C !important; transition: transform .15s, box-shadow .15s; }
.inc-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(140,105,70,.14); }
.inc-btn .ib-ic { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.75); color: #9A6A44; }
.inc-btn .ib-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.inc-btn .ib-t b { font-size: 13px; }
.inc-btn .ib-t small { font-size: 11.5px; color: #8A6A4E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .inc-btn, [data-theme="chalk"] .inc-btn { background: linear-gradient(140deg, #3E352C, #2E2721) !important; border-color: rgba(255,240,220,.08) !important; color: #F1E6D8 !important; }
[data-theme="dark"] .inc-btn .ib-ic, [data-theme="chalk"] .inc-btn .ib-ic { background: rgba(255,240,220,.08); color: #E2B98F; }
[data-theme="dark"] .inc-btn .ib-t small, [data-theme="chalk"] .inc-btn .ib-t small { color: #C9B8A6; }
.inc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.inc-c { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.inc-c small { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.inc-c b { font-size: 20px; font-variant-numeric: tabular-nums; }
.inc-c.got b { color: #4C6E44; } .inc-c.due b { color: #A0562E; }
.inc-c.all { grid-column: 1 / -1; background: linear-gradient(140deg, #FBF6EF, #EADBC6); border-color: rgba(140,105,70,.18); color: #4A3A2C; }
.inc-c.all b { font-size: 26px; color: #5A3E26; }
.inc-c.all span { font-size: 12.5px; color: #8A6A4E; }
[data-theme="dark"] .inc-c.all, [data-theme="chalk"] .inc-c.all { background: linear-gradient(140deg, #3E352C, #2E2721); color: #F1E6D8; } [data-theme="dark"] .inc-c.all b, [data-theme="chalk"] .inc-c.all b { color: #F6EBDD; }
.inc-months { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.im-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.im-l { color: var(--ink-soft); font-weight: 600; }
.im-bar { display: flex; height: 8px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.im-bar i { display: block; height: 100%; } .im-bar .g { background: #8FB283; } .im-bar .d { background: #D9A27A; }
.im-v { text-align: right; display: flex; flex-direction: column; line-height: 1.25; }
.im-v b { font-variant-numeric: tabular-nums; } .im-v em { font-style: normal; font-size: 11px; color: #A0562E; } .im-v em.ok { color: #5E8155; }
.board-card .meta .s { display: flex; align-items: center; gap: 6px; }
.bk { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.bk.warn { background: rgba(217,120,80,.14); color: #B25A35; }
.bk.ok { background: rgba(127,162,114,.14); color: #5E8155; padding: 2px 4px; }
.im-row { grid-template-columns: 112px 1fr auto; } .im-l { white-space: nowrap; }

/* ===== v23: đồng hồ trước lời chào ===== */
.dc-clock { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent-ink); margin-right: 2px; }
.gr-clock { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 800; margin-right: 10px; padding: 0 10px; border-radius: 12px; background: var(--hx); letter-spacing: -.5px; }

/* ===== v24: giờ nhỏ hơn, ngày to hơn ===== */
.gr-ht small { font-size: 15px; font-weight: 700; opacity: .8; letter-spacing: .1px; }
.gr-clock { font-size: 18px; font-weight: 700; padding: 2px 9px; margin-right: 8px; border-radius: 10px; vertical-align: 4px; letter-spacing: 0; opacity: .85; }
.dc-top small { font-size: 12.5px; font-weight: 600; }
.dc-clock { font-size: .85em; font-weight: 700; opacity: .8; }

/* ===== v26: thanh cuộn dọc tự ẩn cho trang dạy ===== */
#vScroll { position: absolute; right: 4px; top: 70px; bottom: 90px; width: 12px; z-index: 6; opacity: 0; pointer-events: none; transition: opacity .35s ease; border-radius: 8px; }
#vScroll.show { opacity: 1; pointer-events: auto; }
#vScroll::before { content: ""; position: absolute; inset: 0 3px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, transparent); opacity: 0; transition: opacity .2s; }
#vScroll:hover::before, #vScroll.drag::before { opacity: 1; }
#vScroll i { position: absolute; left: 3px; right: 3px; top: 0; min-height: 36px; border-radius: 6px; background: color-mix(in srgb, var(--accent-ink) 45%, transparent); transition: background .15s, left .15s, right .15s; cursor: grab; }
#vScroll:hover i, #vScroll.drag i { left: 1px; right: 1px; background: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
#vScroll.drag i { cursor: grabbing; }

/* ===== v27: tài khoản & đồng bộ ===== */
.acct-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); margin-bottom: 14px; }
.acct-tabs button { padding: 8px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); transition: background .15s, color .15s; }
.acct-tabs button:hover { color: var(--ink); }
.acct-tabs button.on { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 4px rgba(120,85,50,.12); }
.btn.wide { width: 100%; justify-content: center; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.btn.google:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(120,85,50,.1); }
.acct-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; color: var(--muted); font-size: 12px; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acct-form .field { margin-bottom: 10px; }
.acct-form .btn.primary { margin-top: 4px; padding: 10px; }
.link-btn { display: block; margin: 8px auto 0; font-size: 12.5px; color: var(--accent-ink); background: none; border: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.acct-msg { min-height: 18px; margin: 8px 0 0; font-size: 12.5px; color: #B25A35; text-align: center; }
.acct-msg.ok { color: #4C6E44; }
.acct-me { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(140deg, #FBF6EF, #F1E5D5); border: 1px solid rgba(140,105,70,.16); margin-bottom: 12px; color: #4A3A2C; }
.acct-me .avatar, .acct-me img { width: 40px; height: 40px; }
.acct-me b { display: block; font-size: 14.5px; } .acct-me small { font-size: 12px; color: #8A6A4E; }
.acct-me > div { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acct-ok { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: #4C6E44; background: rgba(127,162,114,.16); padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.acct-card { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 10px; }
.acct-card .ac-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.acct-card .ac-h em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: #4C6E44; }
.acct-card p { margin: 0 0 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.acct-card .btn + .btn { margin-left: 6px; }
.acct-foot { display: flex; justify-content: space-between; margin-top: 12px; }
.acct-off { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg); color: var(--ink-soft); }
.acct-off b { display: block; color: var(--ink); } .acct-off small { font-size: 12.5px; line-height: 1.5; }
.rem-cta { margin-top: 8px; }
#topProfile.signed { box-shadow: inset 0 0 0 1.5px rgba(127,162,114,.55); }
[data-theme="dark"] .acct-me, [data-theme="chalk"] .acct-me { background: linear-gradient(140deg, #3E352C, #2E2721); color: #F1E6D8; border-color: rgba(255,240,220,.08); }
[data-theme="dark"] .acct-me small, [data-theme="chalk"] .acct-me small { color: #C9B8A6; }
.acct-foot .danger-text { margin-right: 0; } .acct-me .pf-av, .acct-me .avatar { background: var(--accent); color: #fff; }
.acct-err { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; color: #8A3E20; background: rgba(217,120,80,.12); }
.acct-ok.bad { color: #A0562E; background: rgba(217,120,80,.14); }

/* ===== v31: cửa sổ email xác nhận ===== */
.mail-pop { text-align: center; }
.mail-pop .mp-ic { width: 64px; height: 64px; margin: 4px auto 10px; border-radius: 20px; display: grid; place-items: center; font-size: 32px; background: linear-gradient(140deg, #FBF6EF, #EADBC6); box-shadow: 0 6px 18px rgba(140,105,70,.16); }
.mail-pop h3 { margin: 0 0 6px; font-size: 19px; }
.mail-pop .mp-lead { margin: 0 0 12px; color: var(--ink-soft); line-height: 1.6; }
.mail-pop .mp-lead b { color: var(--ink); word-break: break-all; }
.mail-pop .mp-steps { text-align: left; margin: 0 0 14px; padding: 12px 14px 12px 32px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.mail-pop .mp-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mail-pop .mp-acts .btn { text-decoration: none; }
.mail-pop .mp-msg { min-height: 18px; margin: 8px 0 0; font-size: 12.5px; color: #B25A35; }
.mail-pop .mp-msg.ok { color: #4C6E44; }
.mail-pop .hint { margin-top: 6px; }

/* ===== v32: nhắc sao lưu ===== */
.backup-nudge { display: flex !important; align-items: center; gap: 10px; padding: 9px 12px !important; text-align: left; border-radius: 14px; background: linear-gradient(140deg, #FCEFE6, #F5DCCB) !important; border: 1px solid rgba(190,110,70,.22) !important; color: #6B3A22 !important; margin-bottom: 6px; transition: transform .15s, box-shadow .15s; }
.backup-nudge.hidden { display: none !important; }
.backup-nudge:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(190,110,70,.18); }
.backup-nudge .bn-ic { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.75); color: #C0612E; font-weight: 800; }
.backup-nudge .bn-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.backup-nudge .bn-t b { font-size: 13px; } .backup-nudge .bn-t small { font-size: 11.5px; color: #9A5A3A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="dark"] .backup-nudge, [data-theme="chalk"] .backup-nudge { background: linear-gradient(140deg, #4A3328, #33251E) !important; color: #F6DCCB !important; border-color: rgba(255,200,170,.12) !important; }
[data-theme="dark"] .backup-nudge .bn-t small, [data-theme="chalk"] .backup-nudge .bn-t small { color: #E2B49A; }
.bk-warn { display: flex; gap: 8px; align-items: flex-start; text-align: left; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; color: #8A3E20; background: rgba(217,120,80,.12); }
.bk-list { list-style: none; text-align: left; margin: 0 0 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.8; color: var(--ink-soft); }

/* ---- Chọn cách dùng: Đăng nhập hoặc Khách (v35) ---- */
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-pick .mpk-lead { grid-column: 1 / -1; margin: 0 0 2px; color: var(--ink-2, #6b5d4f); text-align: center; }
.mpk-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 18px 16px 14px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--surface, #fffaf3); color: inherit; font: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.mpk-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(90, 60, 30, .12); }
.mpk-card.acc { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), transparent 70%); }
.mpk-card.guest { border-style: dashed; }
.mpk-card > b { font-size: 16px; }
.mpk-ic { font-size: 26px; line-height: 1; }
.mpk-badge { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: #fff; }
.mpk-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; line-height: 1.45; }
.mpk-card ul.bad li { color: #9a4a2e; }
.mpk-card small { font-size: 12px; color: var(--ink-3, #8f8172); line-height: 1.4; }
.mpk-go { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 13.5px; color: var(--accent-ink); }
.mpk-card.guest .mpk-go { color: var(--ink-2, #6b5d4f); }
@media (max-width: 560px) { .mode-pick { grid-template-columns: 1fr; } }

/* Cửa sổ bắt buộc chọn: bấm ra ngoài chỉ rung nhẹ, không đóng (v36) */
@keyframes vn-nudge { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.nudge { animation: vn-nudge .38s ease; }

/* Hỏi bật thông báo — "Bạn có muốn Vincenink nhắc nhở mình không?" (v41) */
.pa-modal .modal-head { display: none; }
.pa-modal .modal { overflow: hidden; background: linear-gradient(180deg, #F6EBDC 0, #FFFBF5 150px); }
.pa-modal .modal-body { padding: 26px 24px 18px; }
.push-ask { text-align: center; display: flex; flex-direction: column; align-items: center; }
.pa-hero { position: relative; width: 78px; height: 78px; border-radius: 26px; display: grid; place-items: center; margin-bottom: 14px;
  background: radial-gradient(circle at 30% 25%, #FFF8EE, #EBD5B8); box-shadow: 0 10px 26px rgba(150, 105, 60, .22), inset 0 1px 0 rgba(255,255,255,.8); }
.pa-bell { font-size: 38px; line-height: 1; transform-origin: 50% 8%; animation: pa-ring 2.6s ease-in-out .4s infinite; }
.pa-dot { position: absolute; top: 12px; right: 13px; width: 13px; height: 13px; border-radius: 50%; background: #D9784F; border: 2.5px solid #FFF8EE; }
@keyframes pa-ring { 0%, 60%, 100% { transform: rotate(0); } 64% { transform: rotate(16deg); } 68% { transform: rotate(-14deg); } 72% { transform: rotate(10deg); } 76% { transform: rotate(-6deg); } 80% { transform: rotate(3deg); } }
.pa-title { margin: 0 0 6px; font-size: 19px; line-height: 1.3; color: #3E2F22; letter-spacing: -.01em; }
.pa-sub { margin: 0 0 16px; font-size: 13.5px; line-height: 1.5; color: #7A6654; max-width: 320px; }
.pa-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin-bottom: 18px; }
.pa-t { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 16px; background: #FFFDF9; border: 1px solid rgba(140, 105, 70, .16); box-shadow: 0 2px 8px rgba(120, 85, 50, .06); }
.pa-t .pa-e { font-size: 20px; margin-bottom: 4px; }
.pa-t b { font-size: 13.5px; color: #4A3726; }
.pa-t small { font-size: 11.5px; color: #8C7764; line-height: 1.3; }
.pa-yes { width: 100%; justify-content: center; height: 46px; border-radius: 14px; font-size: 15px; gap: 8px; box-shadow: 0 8px 20px rgba(160, 105, 60, .28); }
.pa-later { margin-top: 6px; background: none; border: 0; padding: 9px 14px; font: inherit; font-size: 13.5px; color: #8C7764; cursor: pointer; border-radius: 10px; }
.pa-later:hover { background: rgba(140, 105, 70, .08); color: #5A4532; }
.pa-note { margin: 8px 0 0; font-size: 11.5px; color: #A08E7C; }

/* Cảnh báo khi khách sắp đóng trang (v42) */
.pa-hero.ew { background: radial-gradient(circle at 30% 25%, #FFF6EC, #F2D2B8); }
.pa-hero.ew .pa-bell { animation: none; font-size: 36px; }
.ew-box { display: flex; gap: 8px; align-items: flex-start; text-align: left; width: 100%; padding: 11px 13px; margin-bottom: 16px; border-radius: 14px; background: #F3F6EC; border: 1px solid rgba(95, 130, 85, .22); color: #3F5A36; font-size: 13px; line-height: 1.45; }
.ew-box svg { flex: none; margin-top: 2px; }

/* Chọn giờ tông be (v43) */
.tp-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 14px; border-radius: 12px; border: 1px solid rgba(140, 105, 70, .22); background: linear-gradient(180deg, #FFFCF7, #F6EEE3); color: #4A3726; font: inherit; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tp-btn svg { color: #A57A55; }
.tp-btn:hover:not(:disabled) { border-color: #B5835A; box-shadow: 0 0 0 3px rgba(181, 131, 90, .14); }
.tp-btn:disabled { opacity: .45; cursor: default; }
.tp-pop { position: fixed; z-index: 3000; width: 292px; padding: 14px; border-radius: 18px; background: #FFFBF5; border: 1px solid rgba(140, 105, 70, .18); box-shadow: 0 18px 44px rgba(80, 55, 30, .22); animation: tp-in .14s ease-out; }
@keyframes tp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tp-head { display: flex; align-items: baseline; gap: 10px; padding: 2px 4px 10px; border-bottom: 1px dashed rgba(140, 105, 70, .2); margin-bottom: 8px; }
.tp-head b { font-size: 26px; color: #3E2F22; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tp-head small { font-size: 12px; color: #9A8673; }
.tp-lab { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #A08C78; margin: 8px 4px 6px; }
.tp-grid { display: grid; gap: 5px; }
.tp-grid.h { grid-template-columns: repeat(6, 1fr); }
.tp-grid.m { grid-template-columns: repeat(6, 1fr); }
.tp-grid button { height: 32px; border: 0; border-radius: 10px; background: #F4ECE1; color: #5A4532; font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .12s, transform .08s; }
.tp-grid button:hover { background: #EBDDCB; }
.tp-grid button:active { transform: scale(.95); }
.tp-grid button.on { background: #A8714A; color: #fff; font-weight: 700; box-shadow: 0 4px 10px rgba(150, 100, 60, .3); }
.tp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tp-pop .tp-head { background: none; }
.tp-pop .tp-head small { text-transform: none; letter-spacing: 0; font-weight: 400; white-space: nowrap; }

/* Hướng dẫn khi gửi thử thông báo không hiện (v44) */
.ph-steps { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; color: #4A3A2C; }

/* Trang giới thiệu: 2 lựa chọn Đăng nhập / Khách (v45) */
.wl-choice { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: min(420px, 100%); margin: 0 auto; }
.wl-choice .btn { justify-content: center; height: 46px; border-radius: 14px; font-size: 15px; gap: 8px; }
.wl-choice #btnStartLogin { box-shadow: 0 8px 20px rgba(160, 105, 60, .26); }
.wl-choice #btnStart.ghost { height: 40px; font-size: 14px; }
.wl-gnote { margin: 0; text-align: center; font-size: 12.5px; color: #9A6A4E; }
/* Thanh Đăng nhập / Khách luôn ghim ở đáy trang giới thiệu, có lớp mờ phía trên cho tách khỏi nội dung */
.welcome-card .wl-foot { z-index: 2; padding-top: 14px; padding-bottom: 6px; box-shadow: 0 -1px 0 var(--line); }
.welcome-card .wl-foot::before { content: ''; position: absolute; left: 0; right: 0; top: -28px; height: 28px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--panel)); }

/* Nhắc nhẹ khách đăng nhập (v47) — góc màn hình, không chặn thao tác */
.g-nudge { position: fixed; right: 20px; top: 74px; z-index: 80; width: min(340px, calc(100vw - 32px)); display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; border-radius: 18px;
  background: linear-gradient(160deg, #FFFBF5, #F4E8D8); border: 1px solid rgba(140, 105, 70, .2); box-shadow: 0 16px 40px rgba(80, 55, 30, .2); animation: gn-in .35s cubic-bezier(.2, .9, .3, 1.2); transition: opacity .25s, transform .25s; }
.g-nudge.out { opacity: 0; transform: translateY(-8px); }
@keyframes gn-in { from { opacity: 0; transform: translateY(-12px) scale(.97); } to { opacity: 1; transform: none; } }
.g-nudge .gn-ic { font-size: 26px; line-height: 1; margin-top: 2px; }
.g-nudge .gn-t { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.g-nudge .gn-t b { font-size: 14px; color: #3E2F22; }
.g-nudge .gn-t small { font-size: 12.5px; color: #7A6654; line-height: 1.45; }
.g-nudge .gn-go { align-self: flex-start; margin-top: 8px; }
.g-nudge .gn-x { margin: -4px -4px 0 0; color: #9A8673; }

/* Ghi lịch nhiều thứ một lượt (v48) */
.dp-hint { display: block; margin-top: 7px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.mt-rows { display: grid; gap: 8px; }
.mt-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); animation: fade .15s ease; }
.mt-d { flex: none; width: 70px; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.mt-d.we { color: var(--accent-ink, #A0623D); }
.mt-row .time-row { flex: 1; }
