/* Lancio — component stylesheet. Loads after tokens.css. RTL-first: logical properties only. */
:root { --lc-font: var(--font-sans); --lc-display: var(--font-display); }
.lc, .lc * { box-sizing: border-box; }
.lc { direction: rtl; font-family: var(--lc-font); color: var(--ink); font-size: 15px; line-height: 26px; -webkit-font-smoothing: antialiased; }
.lc :where(button, input, textarea, select) { font: inherit; color: inherit; }
.lc .num { font-family: var(--lc-display); font-variant-numeric: tabular-nums; }
.lc :focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.lc svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lc svg.i.sm { width: 16px; height: 16px; }
.lc .flip { transform: scaleX(-1); } /* directional icons (arrows, chevrons) mirror in RTL */
.lc .muted { color: var(--ink-muted); }
.lc .subtle { color: var(--ink-subtle); }
.lc .t-title1 { font-family: var(--lc-display); font-size: 28px; line-height: 42px; font-weight: 800; margin: 0; }
.lc .t-title2 { font-family: var(--lc-display); font-size: 22px; line-height: 34px; font-weight: 700; margin: 0; }
.lc .t-title3 { font-family: var(--lc-display); font-size: 18px; line-height: 28px; font-weight: 700; margin: 0; }
.lc .t-caption { font-size: 13px; line-height: 22px; }
.lc .t-label { font-size: 12px; line-height: 18px; font-weight: 600; }

/* ---------- subject color hooks ---------- */
.s-rose{--subj:var(--subject-rose);--subj-soft:var(--subject-rose-soft)}
.s-coral{--subj:var(--subject-coral);--subj-soft:var(--subject-coral-soft)}
.s-amber{--subj:var(--subject-amber);--subj-soft:var(--subject-amber-soft)}
.s-olive{--subj:var(--subject-olive);--subj-soft:var(--subject-olive-soft)}
.s-green{--subj:var(--subject-green);--subj-soft:var(--subject-green-soft)}
.s-teal{--subj:var(--subject-teal);--subj-soft:var(--subject-teal-soft)}
.s-sky{--subj:var(--subject-sky);--subj-soft:var(--subject-sky-soft)}
.s-indigo{--subj:var(--subject-indigo);--subj-soft:var(--subject-indigo-soft)}
.s-violet{--subj:var(--subject-violet);--subj-soft:var(--subject-violet-soft)}
.s-magenta{--subj:var(--subject-magenta);--subj-soft:var(--subject-magenta-soft)}
.s-brown{--subj:var(--subject-brown);--subj-soft:var(--subject-brown-soft)}
.s-slate{--subj:var(--subject-slate);--subj-soft:var(--subject-slate-soft)}

/* ---------- Button ---------- */
.lc-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding-inline: var(--space-5); border-radius: var(--radius-md); border: 1px solid transparent; font-weight: 600; cursor: pointer; transition: background .15s, transform .08s; white-space: nowrap; }
.lc-btn:active { transform: translateY(1px); }
.lc-btn--primary { background: var(--accent); color: var(--on-accent); }
.lc-btn--primary:hover, .lc-btn--primary.is-hover { background: var(--accent-hover); }
.lc-btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-control); }
.lc-btn--secondary:hover, .lc-btn--secondary.is-hover { background: var(--surface-sunken); }
.lc-btn--ghost { background: transparent; color: var(--accent); }
.lc-btn--ghost:hover, .lc-btn--ghost.is-hover { background: var(--accent-soft); }
.lc-btn--danger { background: var(--danger); color: var(--surface); }
.lc-btn--sm { min-height: 36px; padding-inline: var(--space-3); font-size: 14px; border-radius: var(--radius-sm); }
.lc-btn[disabled], .lc-btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; }
.lc-btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.lc-btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--on-accent); border-inline-end-color: transparent; animation: lc-spin .7s linear infinite; }
.lc-btn--secondary.is-loading::after { border-color: var(--ink); border-inline-end-color: transparent; }
@keyframes lc-spin { to { transform: rotate(360deg); } }

/* ---------- Status pill + icons ---------- */
.lc-status { display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding-inline: var(--space-2); border-radius: var(--radius-full); font-size: 12px; font-weight: 600; }
.lc-status--done { background: var(--status-done-soft); color: var(--status-done); }
.lc-status--partial { background: var(--status-partial-soft); color: var(--status-partial); }
.lc-status--skipped { background: var(--status-skipped-soft); color: var(--status-skipped); }
.lc-status--todo { background: var(--surface-sunken); color: var(--ink-muted); }

/* ---------- Check (tick box) ---------- */
.lc-check { width: 28px; height: 28px; flex: none; border-radius: var(--radius-xs); border: 2px solid var(--line-control); display: grid; place-items: center; background: var(--surface); color: transparent; }
.lc-check.is-done { background: var(--status-done); border-color: var(--status-done); color: var(--surface); }
.lc-check.is-partial { background: var(--status-partial-soft); border-color: var(--status-partial); color: var(--status-partial); }
.lc-check.is-skipped { background: var(--status-skipped-soft); border-color: var(--status-skipped); color: var(--status-skipped); }

/* ---------- Item chip (list row) ---------- */
.lc-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--line); position: relative; cursor: pointer; }
.lc-item::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--subj, var(--ink-subtle)); }
.lc-item__body { flex: 1; min-width: 0; padding-inline-start: var(--space-1); }
.lc-item__subj { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 18px; font-weight: 600; color: var(--subj); }
.lc-item__subj::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--subj); }
.lc-item__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-item__meta { font-size: 13px; line-height: 22px; color: var(--ink-muted); display: flex; gap: var(--space-2); flex-wrap: wrap; }
.lc-item.is-done .lc-item__title { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: var(--ink-subtle); }
.lc-item__badge { min-width: 20px; height: 20px; padding-inline: 6px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font-size: 12px; line-height: 20px; text-align: center; font-weight: 700; }
.lc-item:hover { border-color: var(--line-control); }

/* ---------- Block (grid cell item) ---------- */
.lc-block { background: var(--subj-soft); color: var(--ink); border-radius: var(--radius-sm); padding: 6px 10px 6px 8px; border-inline-start: 4px solid var(--subj); font-size: 13px; line-height: 20px; cursor: grab; }
.lc-block b { display: block; font-weight: 600; color: var(--subj); font-size: 12px; line-height: 18px; }
.lc-block.is-dragging { box-shadow: var(--shadow-md); transform: rotate(-1.5deg); cursor: grabbing; }
.lc-block.is-ghost { background: transparent; border: 2px dashed var(--subj); border-inline-start-width: 2px; color: var(--ink-muted); }
.lc-block.is-override { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(127,127,127,.12) 6px 7px); }

/* ---------- Segmented status control ---------- */
.lc-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--surface-sunken); }
.lc-seg button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.lc-seg button:hover { background: var(--surface); }
.lc-seg button[aria-pressed="true"].done { background: var(--status-done-soft); color: var(--status-done); border-color: var(--status-done); }
.lc-seg button[aria-pressed="true"].partial { background: var(--status-partial-soft); color: var(--status-partial); border-color: var(--status-partial); }
.lc-seg button[aria-pressed="true"].skipped { background: var(--status-skipped-soft); color: var(--status-skipped); border-color: var(--status-skipped); }

/* ---------- Stepper ---------- */
.lc-stepper { display: inline-grid; grid-template-columns: 44px 1fr 44px; align-items: center; border: 1px solid var(--line-control); border-radius: var(--radius-md); background: var(--surface); height: 48px; min-width: 150px; overflow: hidden; }
.lc-stepper button { height: 100%; border: 0; background: transparent; color: var(--accent); cursor: pointer; display: grid; place-items: center; }
.lc-stepper button:hover { background: var(--accent-soft); }
.lc-stepper button[disabled] { color: var(--ink-subtle); background: transparent; cursor: not-allowed; }
.lc-stepper output { text-align: center; font-family: var(--lc-display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lc-stepper output small { font-family: var(--lc-font); font-size: 12px; font-weight: 400; color: var(--ink-muted); margin-inline-start: 4px; }
.lc-stepper.is-error { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.lc-field { display: grid; gap: 6px; }
.lc-field > label { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.lc-field__err { font-size: 12px; color: var(--danger); display: flex; gap: 4px; align-items: center; }
.lc-input { min-height: 44px; border: 1px solid var(--line-control); border-radius: var(--radius-sm); background: var(--surface); padding: 8px 12px; width: 100%; }
.lc-input::placeholder { color: var(--ink-subtle); }
textarea.lc-input { min-height: 84px; resize: vertical; line-height: 24px; }

/* ---------- Day card (student list) ---------- */
.lc-day { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.lc-day__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); cursor: pointer; }
.lc-day__name { font-family: var(--lc-display); font-weight: 700; font-size: 16px; }
.lc-day__date { color: var(--ink-muted); font-size: 13px; }
.lc-day__count { margin-inline-start: auto; font-size: 13px; color: var(--ink-muted); display: flex; align-items: center; gap: var(--space-2); }
.lc-day__items { display: grid; gap: var(--space-2); padding: 0 var(--space-3) var(--space-3); }
.lc-day.is-today { background: var(--accent-soft); border-color: var(--accent); box-shadow: none; }
.lc-day.is-today .lc-day__name { color: var(--accent); }
.lc-day.is-weekend { background: transparent; box-shadow: none; border-style: dashed; }
.lc-day.is-weekend .lc-day__name { color: var(--ink-subtle); }
.lc-today-tag { font-size: 12px; font-weight: 700; padding: 0 8px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); line-height: 22px; }
.lc-dots { display: inline-flex; gap: 3px; }
.lc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-control); }
.lc-dots i.d { background: var(--status-done); } .lc-dots i.p { background: var(--status-partial); } .lc-dots i.s { background: var(--status-skipped); }

/* ---------- Progress ---------- */
.lc-bar { height: 8px; border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; display: flex; }
.lc-bar > span { display: block; height: 100%; }
.lc-bar .d { background: var(--status-done); } .lc-bar .p { background: var(--status-partial); } .lc-bar .a { background: var(--accent); }
.lc-ring { --v: 60; --size: 72px; --th: 8px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring-color, var(--accent)) calc(var(--v) * 1%), var(--surface-sunken) 0); position: relative; flex: none; }
.lc-ring::before { content: ""; position: absolute; inset: var(--th); border-radius: 50%; background: var(--ring-bg, var(--surface)); }
.lc-ring > span { position: relative; font-family: var(--lc-display); font-weight: 800; font-variant-numeric: tabular-nums; font-size: calc(var(--size) * .26); }

/* ---------- Thread ---------- */
.lc-thread { display: grid; gap: var(--space-3); }
.lc-bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 24px; }
.lc-bubble--me { justify-self: start; background: var(--accent-soft); border-start-start-radius: 4px; }
.lc-bubble--them { justify-self: end; background: var(--surface-sunken); border-start-end-radius: 4px; }
.lc-bubble__meta { font-size: 12px; color: var(--ink-muted); margin-block-end: 2px; display: flex; gap: 6px; align-items: center; }
.lc-bubble.is-unread { box-shadow: inset 0 0 0 1.5px var(--accent); }
.lc-bubble.is-failed { box-shadow: inset 0 0 0 1.5px var(--danger); }
.lc-composer { display: flex; gap: var(--space-2); align-items: flex-end; }
.lc-composer .lc-input { min-height: 44px; border-radius: 22px; }
.lc-icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); cursor: pointer; flex: none; }
.lc-icon-btn--plain { background: transparent; color: var(--ink); }
.lc-icon-btn--plain:hover { background: var(--surface-sunken); }

/* ---------- Notification row ---------- */
.lc-notif { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-block-end: 1px solid var(--line); align-items: flex-start; }
.lc-notif.is-unread { background: var(--accent-soft); }
.lc-notif__icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink-muted); flex: none; }
.lc-notif.is-unread .lc-notif__icon { background: var(--accent); color: var(--on-accent); }
.lc-notif__text { flex: 1; font-size: 14px; line-height: 24px; }
.lc-notif__time { font-size: 12px; color: var(--ink-muted); }
.lc-notif__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; }
.lc-bell { position: relative; }
.lc-bell .lc-count { position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; border-radius: 9px; padding-inline: 4px; background: var(--danger); color: var(--surface); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* ---------- Validity selector ---------- */
.lc-validity { display: grid; gap: var(--space-2); }
.lc-opt { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px solid var(--line-control); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }
.lc-opt__radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-control); margin-top: 3px; flex: none; display: grid; place-items: center; }
.lc-opt.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.lc-opt.is-selected .lc-opt__radio { border-color: var(--accent); }
.lc-opt.is-selected .lc-opt__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.lc-opt__title { font-weight: 600; }
.lc-opt__hint { font-size: 13px; color: var(--ink-muted); line-height: 22px; }
.lc-date { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-control); background: var(--surface); font-size: 14px; }

/* ---------- Subject picker ---------- */
.lc-swatches { display: grid; grid-template-columns: repeat(6, 36px); gap: 10px; }
.lc-swatch { width: 36px; height: 36px; border-radius: 50%; background: var(--subj); border: 0; cursor: pointer; display: grid; place-items: center; color: var(--surface); }
.lc-swatch.is-selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--subj); }
.lc-swatch.is-taken { opacity: .35; }

/* ---------- Week grid (advisor) ---------- */
.lc-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.lc-grid__h { padding: 8px; text-align: center; border-block-end: 1px solid var(--line); background: var(--surface); }
.lc-grid__h b { display: block; font-family: var(--lc-display); font-size: 15px; }
.lc-grid__h span { font-size: 12px; color: var(--ink-muted); }
.lc-grid__h.is-today b { color: var(--accent); }
.lc-grid__h.is-weekend b { color: var(--ink-subtle); }
.lc-grid__t { font-size: 12px; color: var(--ink-subtle); text-align: center; padding-top: 4px; border-inline-end: 1px solid var(--line); }
.lc-grid__c { border-inline-end: 1px solid var(--line); border-block-end: 1px dashed var(--line); padding: 4px; min-height: 64px; display: grid; gap: 4px; align-content: start; }
.lc-grid__c.is-weekend { background: var(--surface-sunken); }
.lc-grid__c.is-drop { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -4px; }

/* ---------- Toolbar, tabs, chips ---------- */
.lc-tabs { display: inline-flex; padding: 3px; border-radius: var(--radius-full); background: var(--surface-sunken); gap: 2px; }
.lc-tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: var(--radius-full); color: var(--ink-muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.lc-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.lc-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding-inline: 10px; border-radius: var(--radius-full); background: var(--surface-sunken); font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.lc-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-size: 12px; font-weight: 700; }

/* ---------- Banner ---------- */
.lc-banner { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 14px; line-height: 24px; }
.lc-banner--info { background: var(--accent-soft); color: var(--ink); }
.lc-banner--info .i { color: var(--accent); }
.lc-banner--warning { background: var(--warning-soft); color: var(--ink); }
.lc-banner--warning .i { color: var(--warning); }
.lc-banner--danger { background: var(--danger-soft); color: var(--ink); }
.lc-banner--danger .i { color: var(--danger); }
.lc-banner .lc-btn { margin-inline-start: auto; }

/* ---------- Table / rows ---------- */
.lc-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; }
.lc-table th { text-align: start; font-size: 12px; font-weight: 600; color: var(--ink-muted); padding: 10px 14px; background: var(--surface); border-block-end: 1px solid var(--line); }
.lc-table td { padding: 12px 14px; border-block-end: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.lc-table tr:last-child td { border-block-end: 0; }
.lc-table tr.is-flagged td:first-child { box-shadow: inset -3px 0 0 var(--danger); }
.lc-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--subj-soft, var(--accent-soft)); color: var(--subj, var(--accent)); font-weight: 700; font-size: 13px; flex: none; }

/* ---------- Usage / invoice ---------- */
.lc-meter { display: grid; gap: 6px; }
.lc-meter__row { display: flex; justify-content: space-between; font-size: 14px; }
.lc-invoice { display: grid; grid-template-columns: 1fr auto auto auto; gap: var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); border-block-end: 1px solid var(--line); font-size: 14px; }

/* ---------- Skeleton ---------- */
.lc-skel { background: linear-gradient(90deg, var(--surface-sunken) 0%, var(--line) 50%, var(--surface-sunken) 100%); background-size: 200% 100%; animation: lc-shimmer 1.4s ease-in-out infinite; border-radius: var(--radius-sm); }
@keyframes lc-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .lc-skel, .lc-btn.is-loading::after { animation: none; } }

/* ---------- Sheet ---------- */
.lc-sheet { background: var(--surface-overlay); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg); padding: var(--space-2) var(--space-5) var(--space-5); }
.lc-sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-control); margin: 0 auto var(--space-3); }

/* ---------- Phone frame (screen previews only) ---------- */
.lc-phone { width: 390px; margin: 0 auto; background: var(--paper); border-radius: 28px; border: 1px solid var(--line); overflow: hidden; position: relative; }
.lc-appbar { display: flex; align-items: center; gap: var(--space-2); padding: 12px var(--space-4); }
.lc-nav { display: flex; justify-content: space-around; padding: 8px 0 12px; border-block-start: 1px solid var(--line); background: var(--surface); }
.lc-nav a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-subtle); text-decoration: none; padding: 4px 12px; border-radius: 12px; }
.lc-nav a.is-active { color: var(--accent); }
.lc-desk { display: grid; grid-template-columns: 232px 1fr; background: var(--paper); min-height: 100%; }
.lc-side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: var(--space-4); display: grid; align-content: start; gap: 4px; }
.lc-side a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.lc-side a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.lc-side a .lc-item__badge { margin-inline-start: auto; }

/* Meta separator: a thin rule, never "·" (U+00B7 looks like the Persian zero «۰» in Vazirmatn). */
.lc .sep { display: inline-block; width: 1px; height: 12px; background: var(--line-control); align-self: center; }
