/* ==========================================================================
   DUT Campus Streak — web
   ========================================================================== */
:root {
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --primary: #2f6bff;
  --primary-2: #7c4dff;
  --primary-soft: rgba(47, 107, 255, 0.12);
  --flame: #ff7a1a;
  --flame-2: #ffb627;
  --success: #12b76a;
  --danger: #f04438;
  --amber: #f79009;
  --violet: #7c4dff;
  --cyan: #06aed4;
  --rose: #ee46bc;

  --bg: #eef3ff;
  --bg-2: #e5edff;
  --surface: #ffffff;
  --surface-2: #f5f8ff;
  --border: rgba(20, 40, 90, 0.08);
  --text: #0f1b3d;
  --muted: #5d6b8a;
  --shadow: 0 1px 2px rgba(16, 30, 70, 0.04), 0 8px 24px rgba(16, 30, 70, 0.07);
  --shadow-lg: 0 20px 50px rgba(16, 30, 70, 0.18);
  --radius: 20px;
  --radius-sm: 14px;
  --hero: linear-gradient(135deg, #2f6bff 0%, #5b4dff 55%, #8b3dff 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0a0f1f;
  --bg-2: #0f1630;
  --surface: #131b33;
  --surface-2: #19223f;
  --border: rgba(160, 180, 255, 0.10);
  --text: #e8edff;
  --muted: #94a0c4;
  --primary-soft: rgba(90, 140, 255, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --hero: linear-gradient(135deg, #2448c9 0%, #4a36d6 55%, #7426d9 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 100% -10%, rgba(124, 77, 255, 0.10), transparent 60%),
    radial-gradient(800px 500px at -10% 0%, rgba(47, 107, 255, 0.12), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 10px; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 12px; }
.row.gap > .field { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.row-end { display: flex; justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.center { text-align: center; display: flex; justify-content: center; align-items: center; }
.pad { padding: 24px; }
.pad-sm { padding: 10px 4px; }
.gap-top { height: 14px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ok-text { color: var(--success); font-weight: 600; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.6; display: inline-block; margin: 0 4px; }
.icon { flex-shrink: 0; }

/* ---------- animations ---------- */
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); } 70% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
@keyframes glow { 0%, 100% { box-shadow: 0 8px 24px rgba(47, 107, 255, 0.35); } 50% { box-shadow: 0 8px 36px rgba(124, 77, 255, 0.6); } }
@keyframes flicker { 0%, 100% { transform: scale(1, 1) skewX(0deg); } 25% { transform: scale(0.97, 1.04) skewX(-2deg); } 50% { transform: scale(1.02, 0.97) skewX(1.5deg); } 75% { transform: scale(0.98, 1.03) skewX(-1deg); } }
@keyframes floaty { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(14px, -18px); } }
@keyframes liveDot { 0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.6); } 100% { box-shadow: 0 0 0 10px rgba(18, 183, 106, 0); } }
@keyframes scan { 0% { top: 8%; } 100% { top: 88%; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.pop-in { animation: popIn 0.5s var(--ease) both; }
.slide-up { animation: slideUp 0.5s var(--ease) both; animation-delay: var(--d, 0ms); }
.slide-down { animation: slideDown 0.45s var(--ease) both; }
.fade-in { animation: fadeIn 0.3s ease both; }
.shake { animation: shake 0.45s both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 14px; font-weight: 700; font-size: 15px;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s, opacity 0.2s;
  white-space: nowrap; user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 18px rgba(47, 107, 255, 0.32); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(47, 107, 255, 0.42); }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }
:root[data-theme='dark'] .btn-ghost { color: #9db8ff; }
.btn-light { background: rgba(255, 255, 255, 0.95); color: #1b2b6b; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-lg { height: 52px; font-size: 16px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn.pulse { animation: pulse 1.8s infinite; }
.btn.glow { animation: glow 2.2s ease-in-out infinite; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); transition: background 0.2s, transform 0.15s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.glass { background: rgba(0, 0, 0, 0.35); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.icon-btn.glass.on { background: #ffd34d; color: #3a2a00; }
.link { color: var(--primary); font-weight: 600; }
:root[data-theme='dark'] .link { color: #9db8ff; }
.link.strong { font-weight: 800; }

/* ---------- inputs ---------- */
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid var(--border); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; font-size: 16px;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--surface); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238090b0' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 80px; line-height: 1.45; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input.has-icon { padding-left: 42px; }
.input.has-action { padding-right: 46px; }
.input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 10px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--muted); }
.form-error { background: rgba(240, 68, 56, 0.1); color: var(--danger); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.success-box, .error-box, .note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.success-box { background: rgba(18, 183, 106, 0.12); color: var(--success); }
.error-box { background: rgba(240, 68, 56, 0.09); color: var(--danger); align-items: center; font-weight: 600; }
.note { background: var(--primary-soft); color: var(--text); }
.note .icon { color: var(--primary); margin-top: 2px; }
.switch { appearance: none; width: 50px; height: 30px; border-radius: 30px; background: var(--border); position: relative; cursor: pointer; transition: background 0.25s; flex-shrink: 0; outline-offset: 3px; }
:root[data-theme='light'] .switch { background: #d6deef; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.3s var(--spring); }
.switch:checked { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.switch:checked::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }

/* segmented */
.segmented { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
.segmented button { position: relative; z-index: 1; height: 38px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); transition: color 0.25s; }
.segmented button.active { color: #fff; }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); transform: translateX(calc(100% * var(--i))); transition: transform 0.4s var(--spring); box-shadow: 0 4px 12px rgba(47, 107, 255, 0.35); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
:root[data-theme='dark'] .chip { color: #a9c1ff; }
.chip-gray { background: rgba(120, 130, 160, 0.14); color: var(--muted) !important; }
.chip-amber { background: rgba(247, 144, 9, 0.15); color: #b45d00 !important; }
:root[data-theme='dark'] .chip-amber { color: #ffb44d !important; }
.chip-success { background: rgba(18, 183, 106, 0.15); color: #0b8a50 !important; }
:root[data-theme='dark'] .chip-success { color: #4ade9a !important; }
.chip-red { background: rgba(240, 68, 56, 0.14); color: var(--danger) !important; }
.chip-blue { background: var(--primary-soft); }
.chip-live { background: var(--success); color: #fff !important; animation: liveDot 1.6s infinite; }

/* spinner + skeleton */
.spinner { display: inline-block; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; opacity: 0.8; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--primary) 10%, var(--surface-2)) 50%, var(--surface) 100%); background-size: 800px 100%; animation: shimmer 1.4s infinite linear; margin-bottom: 12px; border: 1px solid var(--border); }

/* avatar */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, #8ab0ff, #a68bff); color: #fff; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--primary) 55%, transparent); }

/* flame */
.flame { display: inline-flex; align-items: flex-end; justify-content: center; flex-shrink: 0; position: relative; }
.flame svg { overflow: visible; transform-origin: 50% 90%; }
.flame.lit svg { animation: flicker 1.6s ease-in-out infinite; filter: drop-shadow(0 6px 14px rgba(255, 110, 20, 0.55)); }
.flame.lit .flame-inner { animation: flicker 1.1s ease-in-out infinite reverse; transform-origin: 50% 90%; }
.flame.unlit svg { filter: grayscale(1) opacity(0.55); }

/* ---------- empty ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 4px; }
.empty-title { font-weight: 800; font-size: 16px; }
.empty .btn { margin-top: 8px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.list-card, .menu-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; text-align: left; width: 100%; }
.menu-item { transition: background 0.2s, transform 0.15s; }
.menu-item:hover { background: var(--surface-2); }
.menu-item:active { transform: scale(0.98); }
.list-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-icon.blue { background: rgba(47, 107, 255, 0.14); color: var(--primary); }
.list-icon.amber { background: rgba(247, 144, 9, 0.15); color: var(--amber); }
.list-icon.red { background: rgba(240, 68, 56, 0.13); color: var(--danger); }
.list-icon.green { background: rgba(18, 183, 106, 0.14); color: var(--success); }
.list-icon.violet { background: rgba(124, 77, 255, 0.14); color: var(--violet); }
.list-icon.gray { background: rgba(120, 130, 160, 0.14); color: var(--muted); }

/* ---------- layout shell ---------- */
.shell { min-height: 100dvh; }
.main { padding-bottom: calc(96px + var(--safe-b)); }
.page { max-width: 1100px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 16px 24px; animation: fadeIn 0.35s ease both; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; align-items: center; gap: 8px; margin: 0 -6px 16px; min-height: 48px; }
.page-head h1 { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) { .page-head h1 { font-size: 26px; } }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.section-head h2 { font-size: 19px; font-weight: 800; }

.sidebar { display: none; }
.bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr); height: 66px; padding: 6px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg);
}
.bn-pill { position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5); border-radius: 18px; background: var(--primary-soft); transform: translateX(calc(100% * var(--i))); transition: transform 0.45s var(--spring); }
.bn-item { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 700; transition: color 0.2s; }
.bn-item .icon { transition: transform 0.35s var(--spring); }
.bn-item.active { color: var(--primary); }
:root[data-theme='dark'] .bn-item.active { color: #a9c1ff; }
.bn-item.active .icon { transform: translateY(-1px) scale(1.12); }

@media (min-width: 960px) {
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 248px; padding: 22px 14px; background: var(--surface); border-right: 1px solid var(--border); z-index: 30; }
  .side-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; padding: 4px 10px 22px; }
  .side-brand b { font-weight: 900; background: var(--hero); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .sidebar nav { display: flex; flex-direction: column; gap: 4px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; font-weight: 600; color: var(--muted); transition: background 0.2s, color 0.2s; }
  .side-link:hover { background: var(--surface-2); color: var(--text); }
  .side-link.active { background: var(--primary-soft); color: var(--primary); }
  :root[data-theme='dark'] .side-link.active { color: #a9c1ff; }
  .side-foot { margin-top: auto; padding: 10px; }
  .main { margin-left: 248px; padding-bottom: 32px; }
  .bottom-nav { display: none; }
  .page { padding: 28px 32px; }
}

/* splash */
.splash { min-height: 100dvh; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; color: var(--primary); }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow: hidden; }
.auth-bg { position: fixed; inset: 0; background: linear-gradient(160deg, #0d2a8a 0%, #2a2bb8 45%, #5a1fb0 100%); z-index: -1; overflow: hidden; }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 36px 36px; mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 70%); }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.6; animation: floaty 12s ease-in-out infinite; }
.b1 { width: 380px; height: 380px; background: #ff7a1a; top: -120px; right: -80px; }
.b2 { width: 420px; height: 420px; background: #2f6bff; bottom: -160px; left: -120px; animation-delay: -4s; }
.b3 { width: 260px; height: 260px; background: #e14bff; top: 40%; left: 55%; animation-delay: -8s; opacity: 0.35; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 28px; padding: 28px 24px; box-shadow: 0 30px 80px rgba(5, 10, 40, 0.45); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, #1f3fa8, #5b2fd0); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(60, 50, 200, 0.35); }
.brand-name { font-weight: 900; font-size: 18px; letter-spacing: -0.02em; }
.brand-tag { font-size: 13px; color: var(--muted); }
.auth-title { font-size: 26px; font-weight: 900; }
.auth-sub { margin: 4px 0 20px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }

/* ---------- home ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.home-user { display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0; }
.home-user > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.home-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-grid { display: grid; gap: 14px; }
.home-grid .col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.home-grid .col .section-head { margin-top: 6px; }
@media (min-width: 960px) { .home-grid { grid-template-columns: 1fr 1fr; align-items: start; gap: 22px; } .home-grid .col .section-head { margin-top: 0; } }

.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px; color: #fff; background: var(--hero); box-shadow: 0 18px 40px rgba(60, 60, 220, 0.35); min-height: 170px; display: flex; flex-direction: column; }
.hero-orbs span { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.12); animation: floaty 10s ease-in-out infinite; }
.hero-orbs span:first-child { width: 200px; height: 200px; right: -60px; top: -80px; }
.hero-orbs span:last-child { width: 120px; height: 120px; right: 70px; bottom: -60px; animation-delay: -5s; background: rgba(255, 180, 60, 0.18); }
.hero > * { position: relative; }
.hero-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; opacity: 0.9; margin-bottom: 12px; }
.hero-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; opacity: 0.8; }
.hero-title { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.25; margin: 2px 0 6px; }
.hero-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; opacity: 0.92; }
.hero-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.countdown { font-weight: 700; font-size: 14px; background: rgba(255, 255, 255, 0.16); padding: 6px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hero .chip-success { background: rgba(255, 255, 255, 0.95); }

.streak-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; transition: transform 0.2s var(--ease); position: relative; overflow: hidden; }
.streak-card:hover { transform: translateY(-2px); }
.streak-card.lit { background: linear-gradient(135deg, rgba(255, 122, 26, 0.12), rgba(255, 182, 39, 0.08)), var(--surface); border-color: rgba(255, 122, 26, 0.3); }
.streak-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.streak-value { font-size: 34px; font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.streak-card.lit .streak-value { background: linear-gradient(135deg, #ff5e1a, #ffb627); -webkit-background-clip: text; background-clip: text; color: transparent; }
.streak-value small { font-size: 15px; color: var(--muted); font-weight: 700; -webkit-text-fill-color: var(--muted); }
.streak-hint { font-size: 13px; color: var(--muted); }
.ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: var(--border); }
:root[data-theme='light'] .ring-bg { stroke: #e3e9f7; }
.ring-fg { stroke: var(--flame); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1s var(--ease); }
.ring text { font-size: 13px; font-weight: 800; fill: var(--text); }

.class-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; text-align: left; box-shadow: var(--shadow); transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.class-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.class-row:active { transform: scale(0.98); }
.class-row.done { border-color: rgba(18, 183, 106, 0.35); }
.class-row.muted-row { opacity: 0.72; }
.class-time { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 54px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; font-variant-numeric: tabular-nums; }
:root[data-theme='dark'] .class-time { color: #a9c1ff; }
.class-time b { font-size: 15px; font-weight: 800; }
.class-time small { font-size: 11px; opacity: 0.75; }
.class-time.live { background: var(--success); color: #fff; animation: liveDot 1.6s infinite; }
.class-row.done .class-time { background: rgba(18, 183, 106, 0.14); color: var(--success); }
.class-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.class-subject { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.class-meta { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.class-status { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.check-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--success); color: #fff; display: inline-flex; align-items: center; justify-content: center; animation: popIn 0.4s var(--spring) both; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 720px) { .quick-grid { grid-template-columns: repeat(6, 1fr); } }
.quick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; text-align: center; transition: transform 0.2s var(--spring); }
.quick:hover { transform: translateY(-3px); }
.quick:active { transform: scale(0.95); }
.quick-icon { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; }
.tone-blue .quick-icon { background: linear-gradient(135deg, #2f6bff, #5b8cff); }
.tone-amber .quick-icon { background: linear-gradient(135deg, #f79009, #ffc44d); }
.tone-green .quick-icon { background: linear-gradient(135deg, #12b76a, #4ade9a); }
.tone-violet .quick-icon { background: linear-gradient(135deg, #7c4dff, #b18cff); }
.tone-cyan .quick-icon { background: linear-gradient(135deg, #06aed4, #5ee0ff); }
.tone-rose .quick-icon { background: linear-gradient(135deg, #ee46bc, #ff8ad8); }

/* ---------- mission ---------- */
.mission-card { text-align: center; padding: 26px 20px; border-radius: 26px; background: var(--hero); color: #fff; box-shadow: 0 18px 40px rgba(60, 60, 220, 0.3); margin-bottom: 14px; }
.mission-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; background: rgba(255, 255, 255, 0.18); display: flex; align-items: center; justify-content: center; }
.mission-card h2 { font-size: 22px; font-weight: 900; line-height: 1.25; }
.mission-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 12px; font-size: 14px; opacity: 0.95; }
.mission-meta span { display: inline-flex; align-items: center; gap: 5px; }
.mission-meta .chip { background: rgba(255, 255, 255, 0.92); }
.mission-state { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 14px; font-weight: 600; animation: slideUp 0.4s var(--ease) both; }
.mission-state.ok { background: rgba(18, 183, 106, 0.12); color: var(--success); border-color: transparent; }
.mission-state.warn { background: rgba(247, 144, 9, 0.12); color: #b45d00; border-color: transparent; }
:root[data-theme='dark'] .mission-state.warn { color: #ffb44d; }
.mission-state.live { background: rgba(18, 183, 106, 0.1); border-color: rgba(18, 183, 106, 0.3); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); animation: liveDot 1.4s infinite; flex-shrink: 0; }
.req { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.req li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.req .icon { color: var(--primary); margin-top: 1px; }
.sticky-actions { position: sticky; bottom: calc(86px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
@media (min-width: 960px) { .sticky-actions { position: static; } }

/* ---------- camera ---------- */
.camera-page { position: fixed; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; z-index: 50; }
.camera-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 24px; background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent); }
.camera-title { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; font-size: 13px; }
.camera-title b:first-child { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camera-view { position: relative; flex: 1; overflow: hidden; }
.camera-view video, .camera-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder { position: absolute; left: 50%; top: 46%; width: min(78vw, 420px); aspect-ratio: 4 / 3; transform: translate(-50%, -50%); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35); border-radius: 22px; }
.viewfinder > span { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.viewfinder > span:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 20px 0 0 0; }
.viewfinder > span:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 20px 0 0; }
.viewfinder > span:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 20px; }
.viewfinder > span:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 20px 0; }
.viewfinder-hint { position: absolute; top: calc(100% + 16px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 14px; background: rgba(0, 0, 0, 0.5); padding: 6px 14px; border-radius: 999px; }
.camera-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.camera-bottom { position: relative; z-index: 3; padding: 16px 16px calc(18px + var(--safe-b)); background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.6)); display: flex; flex-direction: column; gap: 12px; }
.shutter-row { display: flex; align-items: center; justify-content: space-around; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; padding: 5px; transition: transform 0.15s; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform 0.15s, background 0.2s; }
.shutter:active span { transform: scale(0.85); background: #ffd34d; }
.shutter:disabled { opacity: 0.4; }
.camera-tip { text-align: center; opacity: 0.7; }
.camera-error { background: rgba(240, 68, 56, 0.9); padding: 12px 14px; border-radius: 14px; }
.verify-overlay { position: absolute; inset: 0; background: rgba(5, 10, 40, 0.55); display: flex; align-items: center; justify-content: center; z-index: 4; backdrop-filter: blur(2px); }
.verify-overlay.success { background: rgba(18, 183, 106, 0.45); }
.scanline { position: absolute; left: 6%; right: 6%; height: 3px; background: linear-gradient(90deg, transparent, #6ef2ff, transparent); box-shadow: 0 0 22px #6ef2ff; animation: scan 1.6s ease-in-out infinite alternate; }
.verify-card { background: rgba(15, 22, 50, 0.92); border: 1px solid rgba(255, 255, 255, 0.12); padding: 18px 20px; border-radius: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 260px; }
.vstep { display: flex; align-items: center; gap: 10px; font-weight: 600; opacity: 0.45; transition: opacity 0.3s; }
.vstep.active, .vstep.done { opacity: 1; }
.vdot { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.14); font-size: 12px; font-weight: 800; }
.vstep.done .vdot { background: var(--success); }
.vstep.active .vdot { background: var(--primary); }
.verify-card .muted { color: rgba(255, 255, 255, 0.6); }
.big-check { width: 120px; height: 120px; border-radius: 50%; background: var(--success); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 16px rgba(255, 255, 255, 0.2); }

.summary-card { text-align: center; padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 14px; }
.summary-num { font-size: 48px; font-weight: 900; line-height: 1; background: linear-gradient(135deg, var(--success), #4ade9a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.summary-num small { font-size: 22px; -webkit-text-fill-color: var(--muted); }

/* ---------- leaderboard ---------- */
.lb-filters { display: grid; gap: 10px; margin-bottom: 14px; }
@media (min-width: 640px) { .lb-filters { grid-template-columns: 1fr 1fr; } .lb-filters select { grid-column: span 2; } }
.me-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-radius: 18px; background: var(--hero); color: #fff; text-align: left; margin-bottom: 14px; box-shadow: 0 12px 30px rgba(60, 60, 220, 0.3); }
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; margin: 22px 0 14px; }
.podium-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.podium-avatar { position: relative; animation: popIn 0.6s var(--spring) both; animation-delay: calc(var(--d) + 250ms); }
.podium-medal { position: absolute; bottom: -6px; right: -6px; font-size: 22px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25)); }
.podium-name { font-weight: 800; font-size: 13px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 6px; }
.podium-score { font-size: 12px; color: var(--muted); font-weight: 600; }
.podium-block { width: 100%; border-radius: 16px 16px 6px 6px; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; font-size: 26px; font-weight: 900; color: #fff; background-size: cover; background-position: center; transform-origin: bottom; animation: rise 0.7s var(--ease) both; animation-delay: var(--d); margin-top: 6px; }
.p1 .podium-block { height: 120px; background-color: #f5b400; background-image: linear-gradient(180deg, #ffd34d, #f59f00); }
.p2 .podium-block { height: 92px; background-color: #9aa7c2; background-image: linear-gradient(180deg, #d6deef, #94a3c4); }
.p3 .podium-block { height: 74px; background-color: #d78a4a; background-image: linear-gradient(180deg, #f2b183, #c9733a); }
.podium-block span { text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; text-align: left; overflow: hidden; transition: transform 0.2s var(--ease); }
.lb-row::before { content: ''; position: absolute; inset: 0; background-image: var(--banner, none); background-size: cover; background-position: center; opacity: 0.16; mask-image: linear-gradient(90deg, transparent 30%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); pointer-events: none; }
.lb-row > * { position: relative; }
.lb-row:hover { transform: translateX(3px); }
.lb-row.me { border: 2px solid var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.lb-row.flash { animation: shake 0.6s 2; box-shadow: 0 0 0 4px var(--primary-soft); }
.lb-rank { width: 30px; text-align: center; font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-who { display: flex; flex-direction: column; min-width: 0; }
.lb-who b, .lb-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.lb-score b { font-size: 18px; font-weight: 900; }
.lb-score small { font-size: 11px; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-weight: 700; }
.pcard { margin: -4px -20px -20px; }
.pcard-banner { height: 140px; background: var(--hero); background-size: cover; background-position: center; }
.pcard-avatar { margin-top: -48px; display: flex; justify-content: center; }
.pcard-body { text-align: center; padding: 8px 20px 24px; }
.pcard-name { font-size: 20px; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pcard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.pcard-stats div { background: var(--surface-2); border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; }
.pcard-stats b { font-size: 16px; font-weight: 900; }
.pcard-stats span { font-size: 11px; color: var(--muted); }

/* ---------- schedule ---------- */
.day-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.day-tab { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-weight: 800; transition: all 0.25s var(--ease); }
.day-tab small { font-size: 11px; color: var(--muted); font-weight: 700; }
.day-tab.today { border-color: var(--primary); }
.day-tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(47, 107, 255, 0.35); }
.day-tab.active small { color: rgba(255, 255, 255, 0.8); }
.week-col { display: none; flex-direction: column; gap: 10px; }
.week-col.show { display: flex; }
.week-col h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sched-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--primary); box-shadow: var(--shadow); text-align: left; transition: transform 0.2s var(--ease); }
.sched-card:hover { transform: translateY(-2px); }
.sched-card:nth-child(4n+2) { border-left-color: var(--violet); }
.sched-card:nth-child(4n+3) { border-left-color: var(--flame); }
.sched-card:nth-child(4n) { border-left-color: var(--cyan); }
.sched-time { font-size: 12px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
:root[data-theme='dark'] .sched-time { color: #a9c1ff; }
.sched-card .small { display: flex; align-items: center; gap: 4px; }
@media (min-width: 960px) {
  .day-tabs { display: none; }
  .week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
  .week-col { display: flex; }
  .week-col h3 { font-size: 13px; padding: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); justify-content: center; flex-wrap: wrap; }
  .week-col h3.today { background: var(--primary-soft); color: var(--primary); }
  .sched-card { padding: 10px; font-size: 13px; }
}
.day-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-picker button { height: 42px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 800; font-size: 13px; transition: all 0.2s; }
.day-picker button.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.import-preview { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: 14px; }
.import-item { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.absence-head { padding: 12px 14px; background: var(--surface-2); border-radius: 14px; margin-bottom: 4px; }
.quota { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.quota-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); }
:root[data-theme='light'] .quota-dot { background: #dbe2f2; }
.quota-dot.on { background: var(--amber); }

/* ---------- deadlines ---------- */
.task { display: flex; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); border-left: 5px solid var(--primary); flex-wrap: wrap; }
.task.u-warm { border-left-color: var(--amber); }
.task.u-hot { border-left-color: var(--flame); }
.task.u-overdue { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.task.u-done { border-left-color: var(--success); opacity: 0.8; }
.task-main { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.task-title { font-weight: 800; font-size: 16px; }
.task.u-done .task-title { text-decoration: line-through; text-decoration-color: var(--success); }
.task-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.task-meta > span:first-child { display: inline-flex; align-items: center; gap: 4px; }
.countdown-chip { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.u-hot .countdown-chip { background: rgba(255, 122, 26, 0.14); color: var(--flame); }
.task-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.task-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width 1s linear; }
.u-overdue .task-bar span { background: var(--danger); }
.u-hot .task-bar span, .u-warm .task-bar span { background: linear-gradient(90deg, var(--amber), var(--flame)); }
.task-actions { display: flex; align-items: center; gap: 4px; align-self: center; }

/* ---------- documents ---------- */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
.crumbs button { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.crumbs button.active { background: var(--primary-soft); color: var(--primary); }
.crumb-sep { color: var(--muted); }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.doc { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.doc:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; }
.doc-thumb { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; font-size: 11px; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb.tone-red { background: rgba(240, 68, 56, 0.13); color: var(--danger); }
.doc-thumb.tone-blue { background: rgba(47, 107, 255, 0.13); color: var(--primary); }
.doc-thumb.tone-green { background: rgba(18, 183, 106, 0.13); color: var(--success); }
.doc-thumb.tone-amber { background: rgba(247, 144, 9, 0.15); color: var(--amber); }
.doc-thumb.tone-violet { background: rgba(124, 77, 255, 0.13); color: var(--violet); }
.doc-thumb.tone-gray { background: rgba(120, 130, 160, 0.14); color: var(--muted); }
.doc-info { display: flex; flex-direction: column; min-width: 0; }
.doc-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-grid .doc { flex-direction: column; align-items: stretch; }
.doc-grid .doc-main { flex-direction: column; align-items: stretch; padding: 10px; }
.doc-grid .doc-thumb { width: 100%; height: 110px; font-size: 18px; }
.doc-grid .doc-more { position: absolute; top: 14px; right: 14px; background: color-mix(in srgb, var(--surface) 85%, transparent); width: 34px; height: 34px; }
.page.dropping { outline: 3px dashed var(--primary); outline-offset: -8px; border-radius: 24px; }
.drop-hint { position: fixed; inset: auto 0 120px; margin: auto; width: fit-content; display: flex; align-items: center; gap: 10px; background: var(--primary); color: #fff; padding: 14px 22px; border-radius: 18px; font-weight: 800; box-shadow: var(--shadow-lg); animation: popIn 0.3s var(--spring); z-index: 60; }

/* ---------- profile ---------- */
.profile-hero { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; padding-bottom: 18px; text-align: center; }
.profile-banner { display: block; width: 100%; aspect-ratio: 2.4; background: var(--hero); background-size: cover; background-position: center; position: relative; }
.banner-edit, .avatar-edit { position: absolute; display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); }
.banner-edit { right: 12px; bottom: 12px; padding: 6px 10px; border-radius: 999px; }
.profile-avatar { position: relative; margin-top: -52px; display: inline-block; }
.avatar-edit { right: 0; bottom: 4px; width: 32px; height: 32px; border-radius: 50%; justify-content: center; background: var(--primary); border: 3px solid var(--surface); }
.profile-name { font-size: 22px; font-weight: 900; margin-top: 8px; }
.settings { padding: 10px; }
.settings .card-title { padding: 8px 8px 0; }
.setting { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border-radius: 14px; text-align: left; transition: background 0.2s; cursor: pointer; }
.setting:hover { background: var(--surface-2); }
.setting.danger b { color: var(--danger); }
.crop-frame { position: relative; width: 100%; overflow: hidden; border-radius: 16px; background: #111; touch-action: none; cursor: grab; }
.crop-frame.round::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5); pointer-events: none; }
.crop-frame img { position: absolute; left: 50%; top: 50%; max-width: none; user-select: none; pointer-events: none; }
.zoom-row { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.zoom-row input { flex: 1; accent-color: var(--primary); }

/* ---------- achievements ---------- */
.ach-hero { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; padding: 20px; border-radius: 24px; background: linear-gradient(135deg, #f79009, #ff5e1a 60%, #e1306c); color: #fff; box-shadow: 0 18px 40px rgba(255, 94, 26, 0.3); margin-bottom: 16px; }
.ach-count { font-size: 44px; font-weight: 900; line-height: 1; }
.ach-count small { font-size: 20px; opacity: 0.8; }
.ach-bar { grid-column: span 2; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.3); overflow: hidden; margin-top: 8px; }
.ach-bar span { display: block; height: 100%; background: #fff; border-radius: 8px; transition: width 1s var(--ease); }
.ach-grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .ach-grid { grid-template-columns: 1fr 1fr; } }
.ach { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.ach-badge { width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.ach.unlocked .ach-badge { background: linear-gradient(135deg, #ffe08a, #ffb627); box-shadow: 0 8px 20px rgba(255, 182, 39, 0.4); animation: popIn 0.6s var(--spring) both; }
.ach-progress { height: 6px; border-radius: 6px; background: var(--surface-2); margin: 8px 0 4px; overflow: hidden; }
.ach-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--flame-2), var(--flame)); border-radius: 6px; }
.ach.unlocked .ach-progress span { background: var(--success); }

/* ---------- about ---------- */
.about-hero { text-align: center; padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.about-hero img { border-radius: 24px; box-shadow: var(--shadow-lg); }
.about-name { font-size: 22px; font-weight: 900; margin-top: 8px; }

/* ---------- overlays / sheets ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(5, 10, 30, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn 0.2s ease both; }
.overlay.closing { animation: fadeIn 0.2s ease reverse both; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); animation: sheetUp 0.42s var(--ease) both; padding-bottom: var(--safe-b); }
.sheet.wide { max-width: 680px; }
.overlay.closing .sheet { animation: sheetDown 0.22s ease-in both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet-handle { width: 42px; height: 5px; border-radius: 5px; background: var(--border); margin: 10px auto 0; flex-shrink: 0; }
:root[data-theme='light'] .sheet-handle { background: #d6deef; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 0 20px; flex-shrink: 0; }
.sheet-head h3 { font-size: 19px; font-weight: 800; }
.sheet-body { padding: 14px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 26px; animation: popIn 0.35s var(--spring) both; }
  .overlay.closing .sheet { animation: popIn 0.2s ease reverse both; }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: 16px; }
}
.overlay.center { align-items: center; padding: 20px; }
.overlay.center .sheet { border-radius: 24px; max-width: 420px; animation: popIn 0.35s var(--spring) both; }
.overlay.center.closing .sheet { animation: popIn 0.2s ease reverse both; }
.overlay.center .sheet-handle { display: none; }
.overlay.center .sheet-head { padding-top: 16px; }
.dialog-message { margin: 0 0 4px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dialog-actions .btn { min-width: 96px; }

.meme { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; cursor: pointer; }
.meme-title { font-size: 22px; font-weight: 900; letter-spacing: 0.02em; animation: popIn 0.5s var(--spring) both; }
.meme-title.good { background: linear-gradient(135deg, #12b76a, #2f6bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.meme-title.bad { color: var(--danger); }
.meme-img { max-height: 52dvh; width: auto; border-radius: 16px; box-shadow: var(--shadow); animation: popIn 0.5s var(--spring) 0.1s both; }

/* toasts */
.toasts { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 12px 16px; border-radius: 16px; background: #0f1b3d; color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: slideDown 0.35s var(--spring) both; pointer-events: auto; }
.toast-success { background: linear-gradient(135deg, #0b8a50, #12b76a); }
.toast-error { background: linear-gradient(135deg, #c4320a, #f04438); }
:root[data-theme='dark'] .toast-info { background: #24305a; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 300; }
