/* Nursing Journey: "a premium study journal"
   Paper and linen surfaces, a dusty-rose ribbon that marks where you are,
   champagne-gold foil on the wordmark, warm cocoa ink. */

@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --paper: #FBF5EF;
  --paper-2: #F4E9DF;
  --linen: #FFFCF9;
  --blush: #F6E1DE;
  --blush-2: #EDCDC9;
  --rose: #C68D90;
  --rose-deep: #97565D;
  --rose-ink: #7C424A;
  --gold: #D4B585;
  --gold-deep: #A8864F;
  --gold-ink: #7F6137;
  --cocoa: #573D31;
  --cocoa-deep: #3A2820;
  --muted: #80695A;
  --line: #ECDFD2;
  --line-2: #DFCBB8;
  --sage: #56745A;
  --sage-bg: #E7EFE4;
  --danger: #A0424A;
  --danger-bg: #F9E3E2;
  --amber: #8F6922;
  --amber-bg: #F7EDD8;

  --shadow-sm: 0 1px 2px rgba(87, 61, 49, .06), 0 6px 14px -10px rgba(87, 61, 49, .3);
  --shadow: 0 1px 2px rgba(87, 61, 49, .05), 0 18px 36px -24px rgba(87, 61, 49, .5);
  --shadow-lg: 0 40px 80px -40px rgba(87, 61, 49, .55);

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --font-display: 'Cormorant Garamond', 'Cormorant', Garamond, Georgia, 'Times New Roman', serif;
  --font-body: 'Jost', 'Avenir Next', Avenir, 'Segoe UI', system-ui, -apple-system, sans-serif;

  --sidebar-w: 268px;
  --focus-ring: 0 0 0 3px var(--linen), 0 0 0 5px var(--rose-deep);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--cocoa);
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(246, 225, 222, .75), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(212, 181, 133, .18), transparent 60%),
    var(--paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--rose-ink); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--cocoa-deep); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: .005em; }
h1 { font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem); }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--cocoa-deep); color: var(--linen); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: calc(12px + var(--safe-top)); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------- icons ---------- */
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.icon.fill { fill: currentColor; stroke: none; }
.icon-lg { width: 1.6em; height: 1.6em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.15rem; border-radius: 999px;
  border: 1px solid transparent; background: var(--rose-deep); color: #fff;
  font-weight: 500; font-size: .95rem; letter-spacing: .01em; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--rose-ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: var(--linen); color: var(--cocoa); border-color: var(--line-2); }
.btn-secondary:hover { background: var(--blush); border-color: var(--blush-2); }
.btn-ghost { background: transparent; color: var(--cocoa); }
.btn-ghost:hover { background: rgba(198, 141, 144, .14); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #86343B; }
.btn-gold { background: linear-gradient(135deg, #B99258, #D9BD8D 50%, #B99258); color: var(--cocoa-deep); }
.btn-gold:hover { background: linear-gradient(135deg, #A9844C, #CFB07C 50%, #A9844C); }
.btn-sm { min-height: 36px; padding: .35rem .85rem; font-size: .875rem; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }
.spinner { width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: grid; gap: .35rem; }
.field label, .label { font-size: .875rem; font-weight: 500; color: var(--cocoa); }
.hint { font-size: .8125rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: .6rem .85rem; border-radius: var(--r-sm);
  background: #fff; border: 1px solid var(--line-2); color: var(--cocoa-deep);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(151, 86, 93, .18); }
.input::placeholder, .textarea::placeholder { color: #A8948A; }
.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .95rem; }
.check input { width: 20px; height: 20px; accent-color: var(--rose-deep); }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.input-with-icon { position: relative; }
.input-with-icon .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-with-icon .input { padding-left: 2.4rem; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 3rem; }
.password-wrap .toggle-pw { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.form-error { background: var(--danger-bg); color: var(--danger); border-radius: var(--r-sm); padding: .6rem .85rem; font-size: .9rem; }

/* ---------- surfaces ---------- */
.card { background: var(--linen); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 1.35rem; }
.panel { background: var(--linen); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.25rem 1.35rem; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.panel-head h2, .panel-head h3 { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 500; background: var(--paper-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--sage-bg); color: var(--sage); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }
.pill.rose { background: var(--blush); color: var(--rose-ink); }
.pill.gold { background: #F5E9D3; color: var(--gold-ink); }
.divider { height: 1px; background: var(--line); border: 0; margin: 1.25rem 0; }

/* ---------- landing: an open journal spread ---------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: calc(24px + var(--safe-top)) 18px calc(24px + var(--safe-bottom)); }
.spread {
  width: min(1120px, 100%); display: grid; grid-template-columns: 1fr; background: var(--linen);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden;
}
.spread-page { padding: clamp(28px, 5vw, 56px); }
.spread-cover { text-align: center; background: linear-gradient(180deg, #FFFDFB, var(--linen)); position: relative; }
.spread-choice { background: linear-gradient(180deg, #FFF9F6, #FCF1EE); border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .spread { grid-template-columns: 1.05fr 1fr; }
  .spread-choice { border-top: 0; border-left: 1px solid var(--line); position: relative; display: flex; flex-direction: column; justify-content: center; }
  .spread-choice::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 28px; background: linear-gradient(90deg, rgba(87, 61, 49, .08), transparent); pointer-events: none; }
}
.lamp-mark { width: 54px; height: 54px; color: var(--gold-deep); margin: 0 auto 10px; display: block; }
.wordmark {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(2.1rem, 1.5rem + 3vw, 3.4rem);
  letter-spacing: .16em; line-height: 1.05; margin: 0; text-transform: uppercase;
  background: linear-gradient(110deg, #8A6A3B 0%, #B8955D 30%, #EAD7B1 45%, #B8955D 60%, #8A6A3B 100%);
  background-size: 250% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: foil 2.6s ease-out .25s 1 both;
}
@keyframes foil { from { background-position: 100% 0; } to { background-position: 0 0; } }
.tagline { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); color: var(--cocoa); margin: .75rem auto 0; max-width: 30ch; }
.brand-frame { margin: 28px auto 0; display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); max-width: 100%; }
.brand-frame img { display: block; max-height: 340px; width: auto; max-width: 100%; height: auto; object-fit: contain; border-radius: 10px; }
.brand-plate { margin: 28px auto 0; max-width: 360px; padding: 34px 26px; border-radius: 18px; background: linear-gradient(160deg, var(--blush), #F9ECE6); border: 1px solid var(--blush-2); }
.que-sera { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.35rem; color: var(--rose-ink); margin: 18px 0 0; }
.brand-plate .que-sera { font-size: 2rem; margin: 0; }
.choice-title { font-family: var(--font-display); font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.4rem); text-align: center; margin-bottom: 1.5rem; }
.role-cards { display: grid; gap: 16px; }
.role-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; padding: 22px; border-radius: var(--r-lg); background: var(--linen); border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.role-card::after { content: ''; position: absolute; top: 0; right: 22px; width: 18px; height: 34px; background: var(--rose); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); opacity: .85; }
.role-card.client::after { background: var(--gold); }
.role-icon { grid-row: span 2; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--blush); color: var(--rose-ink); }
.role-card.client .role-icon { background: #F5E9D3; color: var(--gold-ink); }
.role-card h3 { font-size: 1.55rem; }
.role-card p { margin: 0; color: var(--muted); }
.role-card .btn { grid-column: 1 / -1; margin-top: 12px; text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; }
.landing-foot { text-align: center; margin-top: 20px; font-size: .8125rem; color: var(--muted); }

/* ---------- auth screens ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: calc(20px + var(--safe-top)) 16px calc(20px + var(--safe-bottom)); }
.auth-card { width: min(460px, 100%); padding: clamp(24px, 5vw, 40px); }
.auth-card .wordmark { font-size: 1.5rem; letter-spacing: .14em; animation: none; background-position: 40% 0; }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head h1 { font-size: 2rem; margin-top: .75rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper-2); border-radius: 999px; padding: 4px; margin-bottom: 1.25rem; }
.tab { border: 0; background: transparent; min-height: 40px; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--muted); display: grid; place-items: center; text-decoration: none; }
.tab[aria-current="page"] { background: var(--linen); color: var(--cocoa-deep); box-shadow: var(--shadow-sm); }
.back-link { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: 1rem; }
.back-link:hover { color: var(--rose-ink); }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem;
  padding: calc(10px + var(--safe-top)) 16px 10px; background: rgba(255, 252, 249, .92);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .mini-mark { font-family: var(--font-display); font-weight: 600; letter-spacing: .14em; font-size: .95rem; color: var(--gold-ink); text-transform: uppercase; }
.topbar .who { margin-left: auto; font-size: .85rem; color: var(--muted); max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 20px 16px calc(96px + var(--safe-bottom)); width: 100%; max-width: 1200px; margin: 0 auto; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head p { margin: .3rem 0 0; color: var(--muted); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(255, 252, 249, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-bottom));
}
.bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 500; background: none; border: 0; cursor: pointer; }
.bottom-nav .icon { width: 22px; height: 22px; }
.bottom-nav [aria-current="page"] { color: var(--rose-ink); background: var(--blush); }

@media (min-width: 960px) {
  .shell { grid-template-columns: var(--sidebar-w) 1fr; }
  .topbar, .bottom-nav { display: none; }
  .main { padding: 36px 40px 60px; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--linen); border-right: 1px solid var(--line); padding: 28px 18px 20px;
  }
  .sidebar::after { content: ''; position: absolute; top: 18px; bottom: 18px; right: 7px; border-right: 1.5px dashed rgba(168, 134, 79, .35); pointer-events: none; }
}
.side-brand { padding: 0 10px 22px; }
.side-brand .wordmark { font-size: 1.25rem; letter-spacing: .15em; animation: none; background-position: 40% 0; }
.side-brand .role { font-size: .8125rem; color: var(--muted); margin-top: 4px; }
.nav-group { margin-top: 10px; }
.nav-group-title { font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--gold-ink); padding: 10px 14px 4px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem .6rem 1.05rem; margin: 2px 0;
  border-radius: 12px; color: var(--cocoa); text-decoration: none; font-weight: 500; font-size: .95rem; background: none; border: 0; width: 100%; cursor: pointer; text-align: left;
}
.nav-link:hover { background: var(--paper); }
.nav-link .icon { color: var(--muted); }
.nav-link .badge { margin-left: auto; }
/* The ribbon bookmark that marks the current page */
.nav-link[aria-current="page"] { background: var(--blush); color: var(--rose-ink); }
.nav-link[aria-current="page"] .icon { color: var(--rose-deep); }
.nav-link[aria-current="page"]::before {
  content: ''; position: absolute; left: -6px; top: -4px; width: 10px; height: calc(100% + 12px);
  background: var(--rose-deep); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%); border-radius: 2px 2px 0 0;
}
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--rose-deep); color: #fff; font-size: .75rem; display: inline-grid; place-items: center; font-weight: 600; }

/* ---------- more sheet (mobile) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(58, 40, 32, .35); z-index: 60; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--linen); border-radius: 24px 24px 0 0; padding: 12px 14px calc(18px + var(--safe-bottom)); box-shadow: var(--shadow-lg); max-height: 80vh; overflow-y: auto; animation: rise .22s ease-out; }
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 0 auto 10px; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1150px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat { padding: 16px 18px; border-radius: var(--r-md); background: var(--linen); border: 1px solid var(--line); text-decoration: none; color: inherit; display: block; }
.stat .num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; color: var(--cocoa-deep); line-height: 1; }
.stat .lbl { font-size: .875rem; color: var(--muted); margin-top: 6px; }
.stat.attention { background: var(--blush); border-color: var(--blush-2); }
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .dash-grid { grid-template-columns: 1.4fr 1fr; } }
.welcome { padding: 26px; border-radius: var(--r-xl); background: linear-gradient(135deg, #FFF8F5, var(--blush) 140%); border: 1px solid var(--blush-2); margin-bottom: 1.25rem; position: relative; overflow: hidden; }
.welcome h1 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); }
.welcome p { margin: .4rem 0 0; color: var(--cocoa); max-width: 60ch; }
.welcome .lamp-mark { position: absolute; right: 18px; bottom: -6px; width: 120px; height: 120px; opacity: .14; margin: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); min-width: 0; }
.list-plain li:first-child { border-top: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.list-plain .title { font-weight: 500; color: var(--cocoa-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .icon { width: 42px; height: 42px; color: var(--gold-deep); margin-bottom: 8px; }
.empty h3 { color: var(--cocoa); margin-bottom: .35rem; }
.locked { display: grid; gap: .6rem; justify-items: start; padding: 22px; border-radius: var(--r-lg); background: #FDF7EE; border: 1px dashed var(--gold); }

/* ---------- file manager ---------- */
.fm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.fm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.fm-filters .search { flex: 1 1 240px; }
.fm-filters .select { width: auto; min-width: 150px; flex: 0 1 auto; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: var(--linen); }
.seg button { border: 0; background: none; min-height: 44px; min-width: 46px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--blush); color: var(--rose-ink); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 14px; padding: 0; list-style: none; font-size: .95rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs li + li::before { content: '/'; color: var(--line-2); margin: 0 4px; }
.crumbs a, .crumbs button { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: inherit; }
.crumbs a:hover, .crumbs button:hover { background: var(--paper-2); color: var(--cocoa-deep); }
.crumbs [aria-current="page"] { color: var(--cocoa-deep); font-weight: 500; padding: 4px 6px; }
.section-label { font-family: var(--font-display); font-style: italic; font-size: 1.15rem; color: var(--gold-ink); margin: 18px 2px 10px; }
.dropzone-active { outline: 2px dashed var(--rose-deep); outline-offset: 6px; border-radius: var(--r-lg); background: rgba(246, 225, 222, .35); }

.items-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.item { position: relative; display: flex; flex-direction: column; background: var(--linen); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); min-width: 0; }
.item-main { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 12px; text-align: left; background: none; border: 0; cursor: pointer; color: inherit; border-radius: var(--r-md); flex: 1; min-width: 0; text-decoration: none; }
.item-name { font-weight: 500; color: var(--cocoa-deep); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.item-meta { font-size: .8125rem; color: var(--muted); }
.item-foot { display: flex; align-items: center; gap: 6px; padding: 0 10px 10px 14px; flex-wrap: wrap; }
.item-foot .spacer { flex: 1; }
.item .more-btn { color: var(--muted); }
.item.folder .item-main { flex-direction: row; align-items: center; }
.folder-glyph { width: 46px; height: 38px; flex: none; position: relative; }
.folder-glyph svg { width: 100%; height: 100%; }

.type-badge { width: 44px; height: 54px; flex: none; position: relative; border-radius: 6px 14px 6px 6px; display: grid; place-items: end center; padding-bottom: 7px; color: #fff; font-size: .62rem; font-weight: 600; letter-spacing: .06em; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .06); }
.type-badge::before { content: ''; position: absolute; top: 0; right: 0; width: 14px; height: 14px; background: rgba(255, 255, 255, .45); border-radius: 0 0 0 6px; }
.t-pdf { background: #B5646B; }
.t-word { background: #6D7FA3; }
.t-powerpoint { background: #C0845A; }
.t-excel { background: #62845F; }
.t-text { background: #8E7A6B; }
.t-html { background: #876A9A; }
.t-zip { background: #B0904F; }
.t-image { background: #5F8C8A; }
.t-audio { background: #9C6E86; }
.t-video { background: #6F6A9E; }
.t-other { background: #9A8878; }
.type-badge.sm { width: 32px; height: 40px; font-size: .52rem; padding-bottom: 5px; border-radius: 5px 10px 5px 5px; }
.type-badge.sm::before { width: 10px; height: 10px; }

.table-wrap { overflow-x: auto; background: var(--linen); border: 1px solid var(--line); border-radius: var(--r-md); }
table.list { width: 100%; border-collapse: collapse; min-width: 640px; }
table.list th { text-align: left; font-weight: 500; font-size: .8125rem; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
table.list td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .925rem; }
table.list tr:last-child td { border-bottom: 0; }
table.list .name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
table.list .name-cell button, table.list .name-cell a { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--cocoa-deep); font-weight: 500; text-decoration: none; }
table.list .name-cell button:hover, table.list .name-cell a:hover { color: var(--rose-ink); text-decoration: underline; }

/* ---------- menus ---------- */
.menu { position: fixed; z-index: 90; min-width: 210px; max-width: 280px; background: var(--linen); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .12s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.menu button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .7rem; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; font-size: .95rem; color: var(--cocoa); min-height: 42px; }
.menu button:hover, .menu button:focus-visible { background: var(--blush); box-shadow: none; }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 24px); width: 560px; max-height: calc(100vh - 24px); overflow: visible; }
dialog.modal.wide { width: 820px; }
dialog.modal.full { width: min(1200px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(58, 40, 32, .42); backdrop-filter: blur(2px); }
.modal-card { background: var(--linen); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); display: flex; flex-direction: column; max-height: calc(100vh - 24px); animation: pop .16s ease-out; }
.modal-head { display: flex; align-items: center; gap: .75rem; padding: 18px 20px 10px; }
.modal-head h2 { flex: 1; font-size: 1.5rem; }
.modal-body { padding: 6px 20px 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 92vh; }
  .modal-card { border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: var(--safe-bottom); }
}

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(88px + var(--safe-bottom)); display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 28px; left: auto; right: 28px; transform: none; } }
.toast { pointer-events: auto; display: flex; gap: .65rem; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--cocoa-deep); color: #FFF7F2; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; font-size: .95rem; }
.toast.error { background: #7A2F36; }
.toast .icon { margin-top: 2px; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0 2px; }

/* ---------- upload ---------- */
.drop-area { border: 2px dashed var(--line-2); border-radius: var(--r-lg); padding: 26px 16px; text-align: center; background: #FFFDFB; transition: border-color .15s, background-color .15s; }
.drop-area.over { border-color: var(--rose-deep); background: var(--blush); }
.drop-area .icon { width: 36px; height: 36px; color: var(--rose-deep); }
.upload-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.upload-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.upload-row .meta { font-size: .8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row .input { min-height: 38px; padding: .35rem .6rem; }
.progress { height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rose), var(--rose-deep)); transition: width .2s; }
.upload-row.done .progress > span { background: var(--sage); }
.upload-row.failed .progress > span { background: var(--danger); }
.status-text { font-size: .8125rem; }
.status-text.ok { color: var(--sage); }
.status-text.bad { color: var(--danger); }

/* ---------- folder picker ---------- */
.picker { border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; max-height: 46vh; overflow-y: auto; }
.picker-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: left; min-height: 48px; }
.picker-row:last-child { border-bottom: 0; }
.picker-row:hover { background: var(--paper); }
.picker-row[disabled] { opacity: .45; cursor: not-allowed; }
.picker-row .icon { color: var(--gold-deep); }

/* ---------- viewer ---------- */
.viewer { display: grid; gap: 14px; }
.viewer-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.viewer-head .titles { flex: 1; min-width: 220px; }
.viewer-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); word-break: break-word; }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.viewer-body { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.viewer-body.fullscreen { position: fixed; inset: 0; z-index: 150; border-radius: 0; display: flex; flex-direction: column; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); }
.pdf-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 10px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 2; }
.pdf-bar .page-input { width: 64px; min-height: 36px; text-align: center; padding: .25rem; }
.pdf-stage { overflow: auto; background: #EFE6DD; min-height: 60vh; max-height: 80vh; display: flex; justify-content: center; align-items: flex-start; padding: 18px; }
.viewer-body.fullscreen .pdf-stage { max-height: none; flex: 1; }
.pdf-stage canvas { background: #fff; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .35); max-width: none; }
.html-frame { width: 100%; height: 78vh; border: 0; display: block; background: #fff; }
.viewer-body.fullscreen .html-frame { flex: 1; height: auto; }
.text-view { margin: 0; padding: 20px; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .9rem; max-height: 75vh; overflow: auto; color: var(--cocoa-deep); }
.image-view { display: grid; place-items: center; padding: 16px; background: #F4ECE4; }
.image-view img { max-height: 78vh; width: auto; object-fit: contain; }
.doc-card { display: grid; justify-items: center; gap: 10px; padding: 40px 20px; text-align: center; }
.doc-card .type-badge { width: 70px; height: 86px; font-size: .85rem; }
.media-view { padding: 20px; display: grid; place-items: center; background: #F4ECE4; }
.media-view video { width: 100%; max-height: 75vh; }
.side-notes { display: grid; gap: 10px; }

/* ---------- notes ---------- */
.notes-grid { columns: 1; column-gap: 14px; }
@media (min-width: 640px) { .notes-grid { columns: 2; } }
@media (min-width: 1100px) { .notes-grid { columns: 3; } }
.note { break-inside: avoid; margin: 0 0 14px; padding: 16px 16px 12px; border-radius: 6px 6px 18px 6px; border: 1px solid rgba(87, 61, 49, .08); box-shadow: var(--shadow-sm); position: relative; display: block; width: 100%; text-align: left; }
.note h3 { font-size: 1.25rem; margin-bottom: 6px; word-break: break-word; }
.note .body { white-space: pre-wrap; word-break: break-word; font-size: .95rem; max-height: 14em; overflow: hidden; }
.note .note-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.note .pin-flag { position: absolute; top: -1px; right: 18px; width: 14px; height: 24px; background: var(--rose-deep); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.c-cream { background: #FFFBF5; }
.c-blush { background: #FBE9E6; }
.c-sage { background: #EEF3EA; }
.c-sky { background: #EBF1F6; }
.c-lilac { background: #F1ECF6; }
.c-sand { background: #F6EDDD; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--linen), 0 0 0 4px var(--rose-deep); }

/* ---------- tasks ---------- */
.task-add { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 760px) { .task-add { grid-template-columns: 1fr 170px 140px auto; } }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; background: var(--linen); border: 1px solid var(--line); border-radius: var(--r-md); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; background: #fff; cursor: pointer; flex: none; margin-top: 1px; color: transparent; }
.task.done .task-check { background: var(--sage); border-color: var(--sage); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 500; color: var(--cocoa-deep); word-break: break-word; }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.prio-HIGH { background: var(--danger-bg); color: var(--danger); }
.prio-MEDIUM { background: var(--amber-bg); color: var(--amber); }
.prio-LOW { background: var(--sage-bg); color: var(--sage); }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-head h2 { min-width: 200px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cal-dow { background: var(--paper); text-align: center; font-size: .75rem; font-weight: 500; color: var(--muted); padding: 8px 2px; }
.cal-day { background: var(--linen); min-height: 64px; padding: 6px; border: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
@media (min-width: 800px) { .cal-day { min-height: 104px; } }
.cal-day.other { background: #FBF7F2; color: #B9A597; }
.cal-day .d { font-size: .85rem; font-weight: 500; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .d { background: var(--rose-deep); color: #fff; }
.cal-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--rose); }
.cal-chip { font-size: .7rem; line-height: 1.25; padding: 2px 5px; border-radius: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--cocoa-deep); }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; }
.ev-STUDY { background: #E9E2F2; } .dot-STUDY { background: #8C74A8; }
.ev-EXAM { background: #F6D9D8; } .dot-EXAM { background: #B04F58; }
.ev-ASSIGNMENT { background: #E2EAF3; } .dot-ASSIGNMENT { background: #5F7BA0; }
.ev-DEADLINE { background: #F7E5CD; } .dot-DEADLINE { background: #B07A2E; }
.ev-REMINDER { background: #E4EEE3; } .dot-REMINDER { background: #5E8360; }
.ev-PERSONAL { background: #F3E7DE; } .dot-PERSONAL { background: #A07860; }
.ev-RELEASE { background: #F3EAD6; } .dot-RELEASE { background: #A8864F; }
.ev-OTHER { background: #EDE6E1; } .dot-OTHER { background: #8E7A6B; }
.ev-global { outline: 1px solid rgba(168, 134, 79, .7); }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.agenda li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--linen); border: 1px solid var(--line); }
.agenda .bar { width: 5px; align-self: stretch; border-radius: 4px; flex: none; }
.agenda .grow { flex: 1; min-width: 0; }
.cal-layout { display: grid; gap: 16px; }
@media (min-width: 1100px) { .cal-layout { grid-template-columns: 1fr 340px; } }

/* ---------- payments / access ---------- */
.price-card { text-align: center; padding: 28px 20px; border-radius: var(--r-xl); background: linear-gradient(160deg, #FFFBF7, var(--blush) 160%); border: 1px solid var(--blush-2); }
.price { font-family: var(--font-display); font-size: 4rem; font-weight: 700; color: var(--cocoa-deep); line-height: 1; }
.price small { font-size: 1.1rem; font-family: var(--font-body); color: var(--muted); font-weight: 400; }
.qr-frame { display: inline-block; padding: 14px; background: #fff; border-radius: 18px; border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.qr-frame img { display: block; width: min(280px, 70vw); height: auto; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--blush); color: var(--rose-ink); display: grid; place-items: center; font-weight: 600; font-size: .9rem; }
.access-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .access-grid { grid-template-columns: 1fr 1.1fr; align-items: start; } }
.proof-thumb { max-height: 60vh; width: auto; display: block; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- misc ---------- */
.announcement { padding: 14px 16px; border-radius: var(--r-md); background: #FFFBF6; border: 1px solid var(--line); }
.announcement + .announcement { margin-top: 10px; }
.announcement h3 { font-size: 1.2rem; }
.announcement .body { white-space: pre-wrap; margin-top: 4px; font-size: .95rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.loading-block { display: grid; place-items: center; gap: 10px; padding: 50px 10px; color: var(--muted); }
.loading-block .spinner { width: 28px; height: 28px; color: var(--rose); }
.temp-pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.35rem; letter-spacing: .08em; background: #fff; border: 1px dashed var(--gold); border-radius: 12px; padding: 12px; text-align: center; user-select: all; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line-2); background: var(--linen); color: var(--cocoa); border-radius: 999px; padding: .35rem .8rem; min-height: 36px; cursor: pointer; font-size: .875rem; }
.chip-btn[aria-pressed="true"] { background: var(--blush); border-color: var(--blush-2); color: var(--rose-ink); }
.log-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.log-row:first-child { border-top: 0; }
.star-on { color: var(--gold-deep); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .wordmark { background-position: 40% 0; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .toasts { display: none !important; }
}

/* calendar: text chips on wide screens, dots on phones */
.cal-chips-wide { display: none; flex-direction: column; gap: 2px; min-width: 0; }
@media (min-width: 800px) { .cal-chips-wide { display: flex; } .cal-dots { display: none; } }
.content { min-width: 0; }
.panel > .announcement:first-of-type { margin-top: 0; }
