:root {
  --bg: #f6f6f7;
  --panel: #ffffff;
  --panel-2: #f9f9fa;
  --sidebar: #fbfbfb;
  --hover: #f0f0f2;
  --border: #e7e7ea;
  --border-strong: #d8d8dd;
  --text: #131316;
  --text-2: #3c3c44;
  --muted: #6f6f7a;
  --faint: #a0a0aa;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
  --danger: #e5484d;
  --danger-soft: color-mix(in srgb, #e5484d 10%, transparent);
  --success: #2f9e62;
  --success-soft: color-mix(in srgb, #2f9e62 12%, transparent);
  --warn: #c98200;
  --warn-soft: color-mix(in srgb, #e59a00 13%, transparent);
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, .05);
  --shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 6px 20px rgba(16, 16, 20, .06);
  --shadow-lg: 0 24px 60px rgba(16, 16, 20, .22);
  --r: 10px;
  --r-lg: 14px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d0d10;
  --panel: #151518;
  --panel-2: #1a1a1e;
  --sidebar: #111114;
  --hover: #1f1f24;
  --border: #25252b;
  --border-strong: #33333a;
  --text: #ececf0;
  --text-2: #c8c8d0;
  --muted: #92929e;
  --faint: #62626c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { flex: none; display: block; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
::selection { background: var(--accent-soft); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 10px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  z-index: 40;
}
.main { min-width: 0; }
.content { max-width: 1240px; margin: 0 auto; padding: 32px 36px 64px; }
.mobile-bar { display: none; }
.scrim { display: none; }

.ws-switch {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border: 0; background: none; border-radius: var(--r);
  cursor: pointer; text-align: left; position: relative;
}
.ws-switch:hover { background: var(--hover); }
.ws-switch.static { cursor: default; }
.ws-switch.static:hover { background: none; }
.ws-logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 13px; letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.ws-name, .ws-role { display: block; }
.ws-name { font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-role { font-size: 12px; color: var(--muted); }
.ws-text { min-width: 0; flex: 1; }

.nav { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 500;
}
.nav a .i { color: var(--muted); }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.nav a.active .i { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--hover); padding: 0 6px; border-radius: 99px; }

.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 10px; display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- menus ---------- */
.menu {
  position: absolute; z-index: 60; min-width: 240px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px;
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left;
}
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu .sep { height: 1px; background: var(--border); margin: 6px 2px; }
.menu .mini-logo { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; font-weight: 700; display: grid; place-items: center; color: #fff; flex: none; }
.menu .check { margin-left: auto; color: var(--accent); }
.menu .danger { color: var(--danger); }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  font-weight: 550; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-dark:hover { background: color-mix(in srgb, var(--text) 85%, var(--bg)); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn-ghost { background: none; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 0; background: none; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.link { color: var(--accent); font-weight: 550; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 550; font-size: 13px; color: var(--text-2); }
.field label .muted { font-weight: 400; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--panel); color: var(--text); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
.select { appearance: none; padding-right: 32px; 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='%2371717c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.hint { font-size: 12px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.search { position: relative; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 34px; }

.seg { display: inline-flex; padding: 3px; background: var(--hover); border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 550; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 26px 16px; border: 1.5px dashed var(--border-strong); border-radius: 12px;
  background: var(--panel-2); color: var(--muted); cursor: pointer; text-align: center;
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.drop input { display: none; }
.drop b { color: var(--text); font-weight: 600; }
.progress { height: 6px; border-radius: 99px; background: var(--hover); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .2s; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 99px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); position: relative; }
.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 550; background: var(--hover); color: var(--text-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.role-owner { background: color-mix(in srgb, #8b5cf6 13%, transparent); color: #8b5cf6; }
.role-admin { background: color-mix(in srgb, #3b82f6 13%, transparent); color: #3b82f6; }
.role-editor { background: var(--success-soft); color: var(--success); }
.role-trial { background: var(--warn-soft); color: var(--warn); }

.avatar { display: inline-grid; place-items: center; border-radius: 99px; color: #fff; font-weight: 600; flex: none; letter-spacing: -.02em; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; font-weight: 550; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { font-size: 11px; opacity: .6; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.toolbar .search { width: 260px; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .em-icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty h3 { color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty p { max-width: 380px; margin: 0 auto 18px; }

.loading { display: grid; place-items: center; min-height: 50vh; }
.spinner { width: 22px; height: 22px; border-radius: 99px; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 16px; }
.onboard { padding: 22px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.onboard::after { content: ""; position: absolute; right: -80px; top: -80px; width: 240px; height: 240px; border-radius: 99px; background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none; }
.onboard-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.onboard h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin-bottom: 4px; }
.ring { flex: none; position: relative; width: 76px; height: 76px; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 650; font-size: 16px; }
.next-lesson { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); transition: border-color .12s; }
.next-lesson:hover { border-color: var(--accent); }
.next-lesson .mini-thumb { width: 104px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; flex: none; position: relative; }
.next-lesson .lbl { font-size: 12px; color: var(--muted); }
.next-lesson b { display: block; font-weight: 600; }
.next-lesson .go { margin-left: auto; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.stat .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .v { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.rows { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--panel-2); }
.row-item .t { font-weight: 550; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }

.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 550; margin-bottom: 16px; }

/* ---------- tutorials ---------- */
.course-progress { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.course-progress .progress { flex: 1; }
.tut-section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 16px; font-weight: 620; letter-spacing: -.01em; }
.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tut-card { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--border); overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tut-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 70%, #000) 0%, #16161a 70%);
  display: grid; place-items: center; color: rgba(255,255,255,.5);
}
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 99px; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(6px); opacity: 0; transform: scale(.9); transition: .15s; }
.tut-card:hover .play, .next-lesson:hover .play { opacity: 1; transform: none; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; z-index: 1; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; }
.thumb .done-badge { position: absolute; left: 8px; top: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; background: var(--success); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px 2px 5px; border-radius: 99px; }
.thumb .ph { position: relative; }
.tut-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.tut-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tut-body h3 { font-size: 14px; font-weight: 600; line-height: 1.35; }
.tut-body p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.lesson { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 550; margin-bottom: 16px; }
.back:hover { color: var(--text); }
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .ext { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; gap: 12px; padding: 20px; }
.lesson-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 20px 0 10px; flex-wrap: wrap; }
.lesson-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.lesson-desc { color: var(--text-2); white-space: pre-wrap; max-width: 760px; }
.points { margin-top: 22px; padding: 18px 20px; }
.points h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.points ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.points li { display: flex; gap: 10px; color: var(--text-2); }
.points li .i { color: var(--accent); margin-top: 2px; }
.playlist { position: sticky; top: 20px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.playlist .list { overflow-y: auto; padding: 6px; }
.pl-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; color: var(--text-2); }
.pl-item:hover { background: var(--hover); }
.pl-item.on { background: var(--accent-soft); color: var(--text); }
.pl-num { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; background: var(--hover); color: var(--muted); }
.pl-item.done .pl-num { background: var(--success); color: #fff; }
.pl-item.on .pl-num { background: var(--accent); color: #fff; }
.pl-item .t { font-weight: 550; font-size: 13px; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-cat { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 10px 10px 4px; }

/* ---------- board ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(196px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 200px; transition: border-color .12s, background .12s; }
.col.over { border-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-weight: 600; }
.col-head .n { color: var(--muted); font-weight: 500; font-size: 12px; }
.col-head .icon-btn { margin-left: auto; width: 26px; height: 26px; }
.col-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 10px; flex: 1; }
.bcard { background: var(--panel); border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; cursor: pointer; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 9px; transition: border-color .12s, box-shadow .12s; }
.bcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.bcard.dragging { opacity: .4; }
.bcard .bt { font-weight: 550; line-height: 1.35; }
.bcard .bm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bcard .bm .avatar { margin-left: auto; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.due.late { color: var(--danger); font-weight: 550; }
.prio-high { color: var(--danger); }
.col-add { margin: 0 8px 10px; justify-content: flex-start; color: var(--muted); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 550; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--panel-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--panel-2); }
.table .num { text-align: right; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main b { font-weight: 550; display: block; }
.cell-main span { display: block; font-size: 12px; color: var(--muted); }
.file-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--hover); color: var(--muted); }
.file-ic.video { background: var(--accent-soft); color: var(--accent); }
.file-ic.drive { background: color-mix(in srgb, #1fa463 12%, transparent); color: #1fa463; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.mini-prog { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.mini-prog .progress { flex: 1; height: 5px; }
.mini-prog span { font-size: 12px; color: var(--muted); width: 38px; }

.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; font-size: 15px; color: var(--muted); }
.crumbs .i { color: var(--faint); }
.crumb { padding: 4px 8px; border-radius: 7px; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; }
a.crumb:hover { background: var(--hover); color: var(--text); }
.crumb.cur { color: var(--text); font-weight: 620; padding-left: 0; }
.crumb.cur .i { color: var(--accent); }
.section-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 10px; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 22px; }
.folder-tile { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .12s, background .12s, box-shadow .12s; outline: none; }
.folder-tile:hover, .folder-tile:focus-visible { border-color: var(--border-strong); box-shadow: var(--shadow); }
.folder-tile .folder-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.folder-tile .ft { min-width: 0; flex: 1; }
.folder-tile .ft b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-tile .ft span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropt.over { border-color: var(--accent) !important; background: var(--accent-soft) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
a.crumb.over { outline: 2px dashed var(--accent); }
tr.dragging, .folder-tile.dragging { opacity: .4; }
tr[draggable="true"] { cursor: grab; }
#lib { border-radius: var(--r-lg); transition: box-shadow .12s; }
#lib.file-over { box-shadow: 0 0 0 2px var(--accent), 0 0 0 8px var(--accent-soft); }
.drive-frame { width: 100%; height: 620px; border: 0; border-radius: var(--r-lg); background: var(--panel); }

/* ---------- workspaces ---------- */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ws-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.ws-card .top { display: flex; align-items: center; gap: 12px; }
.ws-card .ws-logo { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; }
.ws-card .meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; }
.ws-card .foot { display: flex; gap: 8px; margin-top: auto; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--text-2); margin-bottom: 20px; }
.note .i { color: var(--accent); margin-top: 2px; }

.settings { display: grid; gap: 16px; max-width: 760px; }
.settings .card-pad .field:last-child { margin-bottom: 0; }
.set-foot { display: flex; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 14, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { max-width: 640px; }
.modal form { display: flex; flex-direction: column; min-height: 0; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal header h2 { font-size: 16px; font-weight: 620; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal footer { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--panel-2); border-radius: 0 0 16px 16px; }
.modal footer .err { margin-right: auto; color: var(--danger); font-size: 13px; font-weight: 550; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.cred { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-all; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--text); color: var(--bg); border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 550; animation: pop .2s; max-width: 360px; }
.toast.error { background: var(--danger); color: #fff; }
.toast .i { flex: none; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(800px 400px at 50% -10%, var(--accent-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; padding: 32px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; margin-bottom: 28px; }
.auth-brand .ws-logo { background: var(--text); color: var(--bg); }
.auth h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin-bottom: 6px; }
.auth .sub { color: var(--muted); margin-bottom: 24px; }
.auth .err { color: var(--danger); font-weight: 550; font-size: 13px; min-height: 20px; margin-bottom: 8px; }
.google-btn { height: 42px; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.drive-state { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); margin-bottom: 16px; }
.drive-state .gd { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--border); flex: none; }
.drive-state b { display: block; font-weight: 600; }
.drive-state span { display: block; font-size: 13px; color: var(--muted); }
.drive-state .actions { margin-left: auto; }
.store-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .home-grid, .two-col { grid-template-columns: 1fr; }
  .lesson { grid-template-columns: 1fr; }
  .playlist { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); }
  .mobile-bar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--sidebar); position: sticky; top: 0; z-index: 20; font-weight: 600; }
  .mobile-bar .ws-logo { width: 26px; height: 26px; font-size: 11px; border-radius: 7px; }
  .content { padding: 20px 16px 48px; }
  .toolbar .search { width: 100%; }
  .row2 { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(5, 82vw); }
  .hide-sm { display: none; }
}
