@import url("akee-theme.css");
@import url("premium-motion.css");

:root {
  --page: var(--akee-page);
  --surface: var(--akee-surface);
  --surface-muted: var(--akee-neutral-soft);
  --ink: var(--akee-ink);
  --muted: var(--akee-muted);
  --line: var(--akee-line);
  --line-strong: var(--akee-line-strong);
  --brand: var(--akee-orange-fill);
  --brand-strong: var(--akee-orange-ink);
  --accent: var(--akee-focus);
  --accent-soft: var(--akee-blue-soft);
  --success: var(--akee-success);
  --warning: var(--akee-warning);
  --danger: var(--akee-danger);
  --focus: var(--akee-focus);
  --radius: var(--akee-radius-card);
  --nav-width: var(--akee-sidebar-width);
  --content-width: var(--akee-frame-max);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--akee-font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea { font: inherit; letter-spacing: 0; }

button,
a,
input,
select,
textarea,
summary { outline: none; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

a { color: var(--brand-strong); }

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -60px;
  left: 16px;
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell { min-height: 100vh; }

.side-nav {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: var(--nav-width);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #23343a;
  background: #17272c;
  color: #f5f8f8;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  padding: 14px 18px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.brand-link img {
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.primary-nav {
  display: grid;
  gap: 4px;
  padding: 16px 10px;
}

.primary-nav a,
.primary-nav button {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 9px 12px;
  color: #dce7e8;
  text-decoration: none;
  font-weight: 650;
}

.primary-nav a:hover,
.primary-nav button:hover,
.primary-nav a[aria-current="page"] {
  background: #284148;
  color: #fff;
}

.nav-spacer { flex: 1; }

.nav-status {
  margin: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  padding: 14px 6px 2px;
  color: #b9c9cc;
  font-size: 0.82rem;
}

.app-column {
  min-width: 0;
  margin-left: var(--nav-width);
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.96);
}

.breadcrumb {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.breadcrumb a { color: var(--muted); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.purchase-credits-button,
.buy-more-credits-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--akee-line);
  border-radius: var(--akee-radius-control);
  padding: 8px 13px;
  background: var(--akee-orange-soft);
  color: var(--akee-orange-ink);
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.purchase-credits-button:hover,
.buy-more-credits-button:hover { background: #ffe7d5; }
.purchase-credits-button .akee-icon,
.buy-more-credits-button .akee-icon { width: 18px; height: 18px; }

.ak-study-features-button,
.auth-study-features-entry {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--akee-line);
  border-radius: var(--akee-radius-control);
  padding: 8px 13px;
  background: var(--akee-blue-soft);
  color: var(--akee-blue-ink);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.akee-enhanced .top-header > .ak-study-features-button,
.global-tool-header > .ak-study-features-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ak-study-features-button:hover,
.auth-study-features-entry:hover {
  border-color: var(--akee-blue);
  background: #e6f5f8;
}

.ak-study-features-button .akee-icon,
.auth-study-features-entry .akee-icon { width: 17px; height: 17px; }

.auth-study-features-entry {
  position: fixed;
  z-index: 50;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
}

.account-label {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-content {
  width: min(100%, calc(var(--content-width) + 48px));
  margin: 0 auto;
  padding: 30px 24px 56px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-heading h1,
.welcome-block h1 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.15;
}

.page-heading p,
.welcome-block p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.welcome-block {
  margin-bottom: 30px;
  border-left: 5px solid var(--brand);
  padding: 8px 0 8px 18px;
}

.section-band {
  margin-top: 32px;
  border-top: 1px solid var(--line-strong);
  padding-top: 20px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-header h2 { margin: 0; font-size: 1.24rem; }
.section-header p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

.button-row,
.inline-actions,
.filters,
.dialog-actions,
.upload-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.button-primary {
  border-color: var(--brand-strong);
  background: var(--brand);
  color: #fff;
}

.button-primary:hover { background: var(--brand-strong); }

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover { background: var(--surface-muted); }

.button-danger {
  border-color: #c45c52;
  background: #fff;
  color: var(--danger);
}

.button-text {
  border-color: transparent;
  background: transparent;
  color: var(--brand-strong);
}

.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.course-grid,
.tool-grid,
.assignment-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.course-card,
.tool-card,
.assignment-type-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.course-card a,
.tool-card a,
.tool-card button {
  width: 100%;
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: var(--radius);
  padding: 16px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.course-card a:hover,
.tool-card a:hover,
.tool-card button:hover { background: #f7faf9; }

.course-card img,
.tool-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #d9ece9;
  object-fit: cover;
  color: var(--brand-strong);
  font-weight: 900;
}

.card-copy { min-width: 0; }

.card-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-description {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-panel {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}

.status-panel h3 { margin: 0; font-size: 1rem; }
.status-panel p { margin: 5px 0 0; color: var(--muted); }
.status-panel .button { margin-top: 12px; }
.status-panel[data-state="failed_retryable"],
.status-panel[data-state="failed_final"] { border-left-color: var(--danger); }
.status-panel[data-state="stale"],
.status-panel[data-state="needs_review"],
.status-panel[data-state="waiting_user"] { border-left-color: var(--warning); }
.status-panel[data-state="ready"] { border-left-color: var(--success); }

.notice {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 14px;
  background: #f8fbfb;
  color: var(--ink);
}

.notice[role="alert"] { border-color: #d99790; background: #fff7f6; color: #6e211c; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.top-gap { margin-top: 20px; }
.plain-fieldset { border-right: 0; border-bottom: 0; border-left: 0; padding-inline: 0; }

.field label,
.field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 750;
}

.field-hint,
.field-error {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.field-error { min-height: 1.2em; color: var(--danger); }

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
}

textarea { min-height: 118px; resize: vertical; }

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: var(--danger); }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
caption { padding: 12px; text-align: left; font-weight: 800; }
th,
td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #e9eff0; font-size: 0.82rem; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge[data-tone="success"] { background: #dff3e8; color: #145334; }
.status-badge[data-tone="warning"] { background: #fff0c9; color: #704800; }
.status-badge[data-tone="danger"] { background: #ffe2df; color: #7e251e; }

.course-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 15px 2px;
}

.course-list-row:last-child { border-bottom: 0; }
.course-list-row h3 { margin: 0; font-size: 1rem; }
.course-list-row p { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }

.filter-search { width: min(360px, 100%); }

.upload-zone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  background: #f8fbfb;
}

.upload-zone.is-dragging { border-color: var(--brand); background: #eaf6f4; }
.upload-zone h3 { margin: 0; font-size: 1rem; }
.upload-zone p { margin: 5px 0 12px; color: var(--muted); font-size: 0.88rem; }
.upload-zone input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.upload-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.upload-progress { width: min(180px, 100%); }
progress { width: 100%; accent-color: var(--brand); }

.assignment-type-card { position: relative; padding: 16px; }
.assignment-type-card label { display: block; cursor: pointer; }
.assignment-type-card input { width: auto; min-height: 0; margin-right: 8px; }
.assignment-type-card h3 { display: inline; margin: 0; font-size: 1rem; }
.assignment-type-card p { margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; }
.assignment-type-card.is-disabled { background: #eef1f2; color: #66757b; }
.assignment-type-card.is-disabled label { cursor: not-allowed; }
.validated-input { position: relative; }
.validated-input input { padding-right: 44px; }
.validation-success { position: absolute; top: 50%; right: 13px; color: var(--success); transform: translateY(-50%); }
.selected-type-line { margin: 16px 0 0; }

dialog {
  width: min(540px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
}

dialog::backdrop { background: rgba(13, 25, 29, 0.58); }
.dialog-body { padding: 22px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-header h2 { margin: 0; font-size: 1.25rem; }
.dialog-header p { margin: 5px 0 0; color: var(--muted); }
.dialog-actions { justify-content: flex-end; margin-top: 20px; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
  background: #17272c;
}

.auth-context {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: #eef5f5;
}

.auth-context h1 { max-width: 440px; margin: 0; font-size: 2.4rem; line-height: 1.15; }
.auth-context p { max-width: 500px; color: #c3d1d3; }

.auth-form-column {
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--page);
}

.auth-panel { width: min(460px, 100%); }
.auth-panel h2 { margin: 0; font-size: 1.75rem; }
.auth-panel > p { margin: 7px 0 22px; color: var(--muted); }
.auth-panel .button { width: 100%; margin-top: 8px; }
.auth-meta { margin-top: 18px; color: var(--muted); font-size: 0.9rem; }

.toast {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  width: min(390px, calc(100vw - 36px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 13px 15px;
  background: #17272c;
  color: #fff;
  box-shadow: 0 14px 32px rgba(17, 34, 39, 0.22);
}

@media (max-width: 980px) {
  :root { --nav-width: 176px; }
  .course-grid,
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-label { display: none; }
}

@media (max-width: 720px) {
  .side-nav {
    position: sticky;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid #23343a;
  }

  .brand-link { min-height: 58px; border-bottom: 0; padding: 9px 12px; }
  .brand-link span { display: none; }
  .brand-link img { width: 34px; height: 34px; }
  .primary-nav { display: flex; min-width: 0; overflow-x: auto; padding: 7px 4px; }
  .primary-nav a { min-height: 38px; padding: 7px 10px; white-space: nowrap; }
  .nav-spacer,
  .nav-status { display: none; }
  .app-column { margin-left: 0; }
  .topbar { min-height: 58px; padding: 9px 14px; }
  .topbar-actions .button-text { display: none; }
  .page-content { padding: 24px 16px 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-heading h1,
  .welcome-block h1 { font-size: 1.72rem; }
  .course-grid,
  .tool-grid,
  .assignment-type-grid,
  .upload-layout,
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .filters { align-items: stretch; flex-direction: column; }
  .filter-search { width: 100%; }
  .course-list-row { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; background: var(--page); }
  .auth-context { padding: 24px 20px; background: #17272c; }
  .auth-context h1 { font-size: 1.6rem; }
  .auth-context p { margin-bottom: 0; }
  .auth-form-column { place-items: start stretch; padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Final light shell styling; legacy selectors above remain only for compatible pages. */
body { background: var(--page); }

.side-nav {
  border-right-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 4px 0 18px rgba(46, 54, 64, 0.04);
}

.brand-link {
  border-bottom-color: var(--line);
  color: var(--ink);
}

.brand-link img { object-fit: contain; }
.primary-nav a { color: var(--muted); }
.primary-nav a:hover { background: var(--akee-blue-soft); color: var(--ink); }
.primary-nav a[aria-disabled="true"] { cursor: not-allowed; color: var(--muted); opacity: 0.62; }
.primary-nav a[aria-disabled="true"]:hover { background: transparent; color: var(--muted); }
.primary-nav a[aria-current="page"] {
  border-left: 3px solid var(--brand);
  background: var(--akee-surface-soft);
  color: var(--ink);
}
.nav-status { border-top-color: var(--line); color: var(--muted); }

.topbar {
  min-height: var(--akee-header-height);
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.account-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--akee-surface-soft);
  object-fit: cover;
}

.button-primary { border-color: var(--brand-strong); background: var(--brand); color: var(--akee-white); }
.button-primary:hover { background: var(--brand-strong); }
.button-secondary { background: var(--surface); }
.button-text { color: var(--brand-strong); }

.welcome-block {
  border-left: 0;
  padding: 0;
}

.dashboard-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 28px;
  min-height: 260px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0 28px;
}

.dashboard-welcome h1 { margin: 0; font-size: 2.25rem; line-height: 1.16; }
.dashboard-welcome p { max-width: 680px; color: var(--muted); }
.dashboard-hero {
  width: 100%;
  max-height: 260px;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

.course-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.course-card { overflow: hidden; }
.course-card a {
  min-height: 190px;
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
}
.course-card img {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  align-self: center;
  background: transparent;
  object-fit: contain;
}
.course-progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--akee-blue-soft);
}
.course-progress > span { display: block; height: 100%; background: var(--brand); }

.tool-card.is-disabled {
  border-style: dashed;
  background: var(--akee-neutral-soft);
  color: var(--muted);
}
.tool-card.is-disabled button { cursor: not-allowed; }

.choice-fieldset {
  min-width: 0;
  margin: 18px 0 0;
  border: 0;
  padding: 0;
}
.choice-fieldset legend { margin-bottom: 8px; font-weight: 750; }
.choice-image-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.choice-image-grid label {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.choice-image-grid label:hover { background: var(--akee-blue-soft); }
.choice-image-grid input {
  position: absolute;
  width: 1px;
  min-height: 0;
  opacity: 0;
}
.choice-image-grid img { width: 82%; height: 82%; object-fit: contain; }
.choice-image-grid label:has(input:checked) {
  border: 2px solid var(--brand);
  background: var(--akee-surface-soft);
}
.choice-image-grid label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.avatar-grid { grid-template-columns: repeat(10, minmax(48px, 1fr)); }
.avatar-grid label { border-radius: 50%; }
.avatar-grid img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.entitlement-line,
.entitlement-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  background: var(--akee-blue-soft);
}
.entitlement-line a { margin-left: auto; font-weight: 750; }
.entitlement-panel h2 { margin: 0; font-size: 1rem; }
.entitlement-panel p { margin: 3px 0 0; color: var(--muted); }

.profile-fields { display: grid; gap: 20px; max-width: 920px; }
.field-label { display: block; margin-bottom: 6px; font-weight: 700; }
.immutable-field-value {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-left: 3px solid var(--brand);
  padding: 9px 12px;
  background: var(--akee-neutral-soft);
  color: var(--ink);
  font-weight: 750;
  overflow-wrap: anywhere;
}
.quota-counter {
  display: inline-block;
  margin-left: 8px;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}
.quota-guidance {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}
.quota-dialog-counter {
  margin: 0 0 12px;
  color: var(--brand-strong);
  font-size: 0.9rem;
  font-weight: 800;
}
.requirement-lock-hint {
  max-width: 860px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}
.assignment-create-dialog-body { display: grid; gap: 18px; }
#assignment-create-dialog { width: min(760px, calc(100vw - 28px)); }
#assignment-create-dialog .assignment-type-grid { margin-top: 10px; }
.field-status { min-height: 1.2em; margin: 5px 0 0; color: var(--success); font-size: 0.82rem; }

.billing-layout { display: grid; gap: 24px; max-width: 820px; }
.billing-product {
  border-top: 1px solid var(--line-strong);
  padding-top: 22px;
}
.billing-product h2 { margin: 0; font-size: 1.35rem; }
.billing-product p { color: var(--muted); }
.eyebrow { margin: 0 0 4px; color: var(--brand-strong) !important; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.quantity-stepper { display: grid; grid-template-columns: 40px 84px 40px; gap: 8px; align-items: center; margin: 20px 0 12px; }
.quantity-stepper input { min-height: 40px; text-align: center; }
.billing-price { min-height: 2rem; margin: 0 0 14px; color: var(--ink) !important; font-size: 1.5rem; font-weight: 800; }
.quick-credit-choice { max-width: 220px; margin-top: 20px; }

.course-source-section {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line-strong);
  padding: 24px 0;
}

.course-source-section .section-header { margin: 0; }
.source-group-title { margin: 8px 0 0; font-size: 0.9rem; }
.source-file-list { display: grid; gap: 8px; min-height: 44px; }
.source-file-row,
.staged-file-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface);
}
.source-file-main { min-width: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 10px; }
.source-file-main > a,
.source-file-main > strong { overflow-wrap: anywhere; }
.source-statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.source-conflict-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.source-empty {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
}
.segmented-control {
  width: fit-content;
  display: grid;
  grid-template-columns: repeat(2, minmax(104px, 1fr));
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  background: var(--akee-neutral-soft);
}
.segmented-control button { min-height: 38px; border: 0; background: transparent; }
.segmented-control button[aria-pressed="true"] { background: var(--surface); color: var(--brand-strong); box-shadow: var(--shadow-sm); }
.staged-file-list { display: grid; gap: 8px; margin-top: 14px; }
.staged-file-row small { color: var(--muted); }
.staged-file-row.is-duplicate {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.course-upload-progress-wrap { min-width: min(320px, 70vw); margin-top: 8px; }
.course-upload-progress {
  width: min(320px, 100%);
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}
.course-upload-progress > span {
  width: var(--course-upload-progress, 0%);
  height: 100%;
  display: block;
  background: var(--brand);
  transition: width 180ms ease;
}
.course-upload-task-row .field-hint { display: block; margin-top: 5px; }

.auth-page { grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr); background: var(--page); }
.auth-context {
  background: var(--akee-surface-soft);
  color: var(--ink);
}
.auth-context p { color: var(--muted); }
.auth-context .brand-link { width: fit-content; border: 0; padding: 0; }
.auth-form-column { background: var(--surface); }
.auth-panel { width: min(480px, 100%); }

dialog::backdrop { background: rgba(46, 54, 64, 0.52); }
.dialog-body { background: var(--surface); }

@media (max-width: 1080px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avatar-grid { grid-template-columns: repeat(5, minmax(48px, 1fr)); }
}

@media (max-width: 720px) {
  .side-nav { border-bottom-color: var(--line); background: var(--surface); }
  .dashboard-welcome { grid-template-columns: 1fr; }
  .dashboard-hero { max-height: 180px; }
  .course-grid,
  .tool-grid { grid-template-columns: 1fr; }
  .choice-image-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .avatar-grid { grid-template-columns: repeat(4, minmax(48px, 1fr)); }
  .entitlement-panel { align-items: flex-start; flex-direction: column; }
  .source-file-row,
  .staged-file-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .source-file-row > .icon-button,
  .staged-file-row > .icon-button { justify-self: end; }
  .segmented-control { width: 100%; }
  .auth-context { background: var(--akee-surface-soft); }
  .auth-page { grid-template-columns: 1fr; }
}

/* Academic Minimal application frame. */
.app-shell.akee-enhanced {
  min-height: 100vh;
  padding: 16px 20px 24px;
  background: var(--page);
}

.akee-enhanced .app-frame {
  width: min(var(--akee-frame-max), calc(100vw - 40px));
  margin: 0 auto;
}

.akee-enhanced .top-header {
  position: relative;
  z-index: 40;
  height: var(--akee-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  border: 1px solid var(--akee-line-soft);
  border-radius: var(--akee-radius-header);
  padding: 8px 14px 8px 18px;
  background: var(--akee-surface);
  box-shadow: var(--akee-shadow-header);
}

.akee-enhanced .header-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 40px;
  color: var(--ink);
  text-decoration: none;
}

.akee-enhanced .header-brand img {
  width: auto;
  height: 34px;
  object-fit: contain;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.version-tag {
  position: relative;
  isolation: isolate;
  min-height: 34px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  border: 1px solid rgba(155, 225, 239, 0.25);
  border-radius: 10px;
  padding: 7px 13px 7px 11px;
  color: #dcecf4;
  background: linear-gradient(135deg, rgba(33, 55, 70, 0.58), rgba(10, 18, 28, 0.76));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    inset 0 -1px rgba(255, 255, 255, 0.025),
    0 10px 28px rgba(0, 0, 0, 0.23),
    0 0 24px rgba(80, 202, 226, 0.055);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
  font-family: "Avenir Next", "Nunito Sans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 10.5px;
  font-weight: 620;
  line-height: 1.35;
  letter-spacing: 0.035em;
  white-space: nowrap;
  cursor: default;
  pointer-events: none;
  -webkit-user-select: text;
  user-select: text;
}

.version-tag::before {
  content: "";
  position: relative;
  z-index: 1;
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--akee-orange, #ff762e);
  box-shadow:
    0 0 0 4px rgba(255, 118, 46, 0.09),
    0 0 13px rgba(255, 118, 46, 0.65);
  pointer-events: none;
}

.version-tag::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 34%, rgba(155, 225, 239, 0.035) 72%, transparent);
  pointer-events: none;
}

.commerce-brand-lockup > img {
  width: 176px;
  height: 46px;
  object-fit: contain;
}

@media (min-width: 761px) and (max-width: 1000px) {
  .brand-lockup { gap: 8px; }

  .version-tag {
    min-height: 30px;
    gap: 6px;
    padding: 5px 8px;
    font-size: 8.5px;
    line-height: 1.35;
    letter-spacing: 0.015em;
  }
}

@media (max-width: 760px) {
  .version-tag {
    min-height: 28px;
    gap: 9px;
    border-radius: 8px;
    padding: 5px 10px 5px 9px;
    font-size: 9px;
    line-height: 1.35;
    letter-spacing: 0.025em;
  }

  .commerce-brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .commerce-brand-lockup > img { width: 100px; height: 40px; }
}

@media (prefers-reduced-transparency: reduce) {
  .version-tag {
    background: var(--akee-surface, #0b111d);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.akee-enhanced .header-actions,
.akee-enhanced .account-trigger {
  display: flex;
  align-items: center;
}

.akee-enhanced .header-actions { gap: 8px; }

.global-tool-header > .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.akee-enhanced .account-menu-wrap {
  position: relative;
}

.akee-enhanced .account-trigger {
  min-width: 0;
  max-width: 290px;
  min-height: 44px;
  gap: 9px;
  border: 0;
  border-radius: var(--akee-radius-control);
  padding: 5px 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.akee-enhanced .account-trigger:hover,
.akee-enhanced .account-trigger[aria-expanded="true"] {
  background: var(--akee-surface-warm);
}

.akee-enhanced .account-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--akee-line);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--akee-shadow-icon);
}

.akee-enhanced .account-label {
  min-width: 0;
  max-width: 190px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.akee-enhanced .account-chevron {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.akee-enhanced .account-trigger[aria-expanded="true"] .account-chevron {
  transform: rotate(180deg);
}

.akee-enhanced .account-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: 0;
  width: 178px;
  border: 1px solid var(--akee-line);
  border-radius: var(--akee-radius-card);
  padding: 6px;
  background: var(--akee-surface);
  box-shadow: var(--akee-shadow-panel);
}

.akee-enhanced .account-menu a,
.akee-enhanced .account-menu button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.akee-enhanced .account-menu a:hover,
.akee-enhanced .account-menu button:hover {
  background: var(--akee-orange-soft);
  color: var(--brand-strong);
}

.akee-enhanced .account-menu .akee-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.akee-enhanced .workspace-panel {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--akee-sidebar-width) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--akee-line-soft);
  border-radius: var(--akee-radius-panel);
  background: var(--akee-surface);
  box-shadow: var(--akee-shadow-panel);
}

.akee-enhanced .side-nav {
  position: static;
  z-index: auto;
  inset: auto;
  width: auto;
  min-height: calc(100vh - 116px);
  display: block;
  border: 0;
  border-right: 1px solid var(--akee-line-soft);
  padding: 20px 4px;
  background: var(--akee-surface-soft);
  color: var(--ink);
}

.akee-enhanced .primary-nav {
  display: grid;
  gap: 0;
  padding: 0;
}

.akee-enhanced .nav-group {
  display: grid;
  gap: 4px;
}

.akee-enhanced .nav-divider {
  height: 1px;
  margin: 14px 4px;
  background: var(--akee-line);
}

.akee-enhanced .nav-section-label {
  margin: 0 0 4px;
  padding: 0 5px;
  color: var(--akee-muted);
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.3;
  text-transform: none;
}

.akee-enhanced .primary-nav a,
.akee-enhanced .primary-nav button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--akee-radius-control);
  padding: 9px 5px;
  background: transparent;
  color: var(--akee-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.akee-enhanced .primary-nav a:hover,
.akee-enhanced .primary-nav button:hover {
  background: var(--akee-surface-warm);
  color: var(--ink);
}

.akee-enhanced .primary-nav a[aria-current="page"] {
  background: var(--akee-orange-soft);
  color: var(--akee-orange-ink);
  font-weight: 700;
}

.akee-enhanced .primary-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--akee-orange-strong);
}

.akee-enhanced .primary-nav .akee-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.auth-brand {
  width: fit-content;
}

.auth-brand img {
  width: auto;
  height: 44px;
  object-fit: contain;
}

.akee-enhanced .app-column {
  min-width: 0;
  margin-left: 0;
  background: var(--akee-surface);
}

.akee-enhanced .topbar.workspace-toolbar {
  position: static;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--akee-line-soft);
  padding: 12px 26px;
  background: var(--akee-surface);
}

.akee-enhanced .breadcrumb {
  color: var(--akee-muted);
  font-size: 0.8rem;
}

.akee-enhanced .breadcrumb a {
  color: var(--akee-muted);
  text-underline-offset: 3px;
}

.akee-enhanced .page-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 26px;
}

.akee-enhanced .page-heading {
  margin-bottom: 24px;
}

.akee-enhanced .page-heading h1,
.akee-enhanced .welcome-block h1 {
  color: var(--ink);
  font-size: 1.85rem;
  line-height: 1.2;
}

.akee-enhanced .section-band {
  border-top-color: var(--akee-line-soft);
  padding: 24px 0;
}

.akee-enhanced .section-header h2 {
  color: var(--ink);
  font-size: 1.08rem;
}

.akee-enhanced .section-header p,
.akee-enhanced .page-heading p {
  color: var(--muted);
}

.akee-enhanced .button,
.akee-enhanced .icon-button,
.akee-enhanced input,
.akee-enhanced select,
.akee-enhanced textarea {
  border-radius: var(--akee-radius-control);
}

.akee-enhanced .button-primary {
  border-color: var(--akee-orange-fill);
  background: var(--akee-orange-fill);
  color: #fff;
  box-shadow: 0 5px 12px rgba(234, 84, 36, 0.14);
}

.akee-enhanced .button-primary:hover {
  border-color: var(--akee-orange-ink);
  background: var(--akee-orange-ink);
}

.akee-enhanced .button-secondary {
  border-color: var(--akee-line);
  background: var(--akee-surface);
  color: var(--ink);
}

.akee-enhanced .button-secondary:hover {
  border-color: var(--akee-peach-soft);
  background: var(--akee-surface-warm);
}

.akee-enhanced .status-panel,
.akee-enhanced .notice,
.akee-enhanced .data-table-wrap,
.akee-enhanced .course-source-section,
.akee-enhanced .assignment-type-card,
.akee-enhanced .billing-product,
.akee-enhanced .entitlement-panel {
  border-color: var(--akee-line);
  border-radius: var(--akee-radius-card);
  background: var(--akee-surface-soft);
  box-shadow: none;
}

.mobile-nav-toggle,
.nav-backdrop {
  display: none;
}

@media (min-width: 768px) and (max-width: 1099px) {
  .akee-enhanced .workspace-panel {
    grid-template-columns: var(--akee-sidebar-width) minmax(0, 1fr);
  }

  .akee-enhanced .side-nav {
    padding-inline: 4px;
  }

  .akee-enhanced .primary-nav a,
  .akee-enhanced .primary-nav button {
    padding-inline: 5px;
    font-size: 0.75rem;
  }

  .akee-enhanced .page-content {
    padding: 22px;
  }
}

@media (max-width: 767px) {
  .app-shell.akee-enhanced {
    padding: 10px 10px 18px;
  }

  .akee-enhanced .app-frame {
    width: 100%;
  }

  .akee-enhanced .top-header {
    height: 58px;
    margin-bottom: 10px;
    border-radius: 12px;
    padding-inline: 11px 8px;
  }

  .akee-enhanced .header-brand img {
    height: 30px;
  }

  .akee-enhanced .header-actions { gap: 4px; }
  .akee-enhanced .mobile-nav-toggle { display: inline-flex; }
  .akee-enhanced .account-label { display: none; }
  .akee-enhanced .account-trigger { gap: 4px; padding-inline: 5px; }
  .akee-enhanced .account-chevron { display: none; }
  .akee-enhanced .account-menu { right: 0; }

  .akee-enhanced .top-header > .ak-study-features-button,
  .global-tool-header > .ak-study-features-button {
    width: 44px;
    padding-inline: 0;
  }

  .akee-enhanced .top-header > .ak-study-features-button span,
  .global-tool-header > .ak-study-features-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .akee-enhanced .workspace-panel {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    border-radius: 14px;
  }

  .akee-enhanced .side-nav {
    position: fixed;
    z-index: 90;
    top: 80px;
    bottom: 14px;
    left: 14px;
    width: min(280px, calc(100vw - 48px));
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--akee-line);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--akee-shadow-panel);
    transform: translateX(calc(-100% - 24px));
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease, visibility 0s linear 180ms;
  }

  .akee-enhanced.is-nav-open .side-nav {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .akee-enhanced .nav-backdrop {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: none;
    border: 0;
    padding: 0;
    background: rgba(60, 51, 47, 0.28);
  }

  .akee-enhanced.is-nav-open .nav-backdrop { display: block; }

  .akee-enhanced .app-column { grid-column: 1; }
  .akee-enhanced .topbar.workspace-toolbar { padding: 11px 18px; }
  .akee-enhanced .page-content { padding: 20px 16px; }
  .akee-enhanced .section-header { align-items: flex-start; }
}

/* Dashboard composition. */
.akee-enhanced .dashboard-welcome {
  min-height: 184px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  overflow: hidden;
  border: 1px solid var(--akee-line-soft);
  border-radius: var(--akee-radius-card);
  padding: 0;
  background: var(--akee-surface-warm);
  box-shadow: none;
}

.akee-enhanced .dashboard-welcome-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 30px;
}

.akee-enhanced .dashboard-welcome h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
}

.akee-enhanced .dashboard-welcome p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.akee-enhanced .hero-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.akee-enhanced .hero-tool-row button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--akee-line);
  border-radius: var(--akee-radius-pill);
  padding: 6px 11px;
  background: var(--akee-surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.akee-enhanced .hero-tool-row .akee-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.akee-enhanced .dashboard-hero-wrap {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 18px 24px;
  border-left: 1px solid var(--akee-line);
  background: var(--akee-peach-soft);
}

.akee-enhanced .dashboard-hero-wrap::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(166, 58, 20, 0.11);
  pointer-events: none;
}

.akee-enhanced .dashboard-hero {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  height: auto;
  max-height: 142px;
  aspect-ratio: auto;
  object-fit: contain;
}

.akee-enhanced .section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.akee-enhanced .compact-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--akee-radius-pill);
  padding: 7px 12px;
  background: var(--akee-orange-soft);
  color: var(--akee-orange-ink);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.akee-enhanced .compact-action:hover { background: var(--akee-peach-soft); }
.akee-enhanced .compact-action .akee-icon { width: 15px; height: 15px; flex-basis: 15px; }

.akee-enhanced .text-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 7px 0;
  background: transparent;
  color: var(--akee-orange-ink);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.akee-enhanced .text-action:hover { text-decoration: underline; text-underline-offset: 3px; }

.akee-enhanced .course-grid,
.akee-enhanced .assignment-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.akee-enhanced .course-card,
.akee-enhanced .assignment-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--akee-line-soft);
  border-radius: var(--akee-radius-card);
  background: var(--akee-surface);
  box-shadow: var(--akee-shadow-card);
}

.akee-enhanced .course-card a {
  min-height: 82px;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 4px;
  align-items: center;
  gap: 15px;
  padding: 10px 13px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.akee-enhanced .course-card a:hover,
.akee-enhanced .assignment-card a:hover {
  background: var(--akee-surface-warm);
}

.akee-enhanced .course-card img {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  object-fit: contain;
}

.akee-enhanced .course-card .card-copy {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4px;
  align-items: center;
  gap: 15px;
}

.akee-enhanced .course-card .card-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.akee-enhanced .course-accent {
  width: 3px;
  height: 30px;
  justify-self: end;
  border-radius: 3px;
  background: var(--akee-orange);
}

.akee-enhanced .assignment-card a {
  min-height: 118px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  color: var(--ink);
  text-decoration: none;
}

.akee-enhanced .assignment-visual {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--akee-line);
  background: var(--assignment-type-bg, var(--akee-surface-soft));
}

.akee-enhanced .assignment-type-icon {
  width: 64px;
  height: 64px;
  display: block;
  border-radius: 11px;
  object-fit: cover;
}

.akee-enhanced .assignment-theme-essay {
  --assignment-type-bg: #fdf6ed;
  --assignment-type-border: #efb982;
  --assignment-type-ink: #713916;
}

.akee-enhanced .assignment-theme-report {
  --assignment-type-bg: #f1f9fd;
  --assignment-type-border: #8eb9e6;
  --assignment-type-ink: #274f7a;
}

.akee-enhanced .assignment-theme-personal-reflection {
  --assignment-type-bg: #f8f4fd;
  --assignment-type-border: #b99ade;
  --assignment-type-ink: #5d3f7a;
}

.akee-enhanced .assignment-theme-other-assignment {
  --assignment-type-bg: #eefdf6;
  --assignment-type-border: #7fcbb1;
  --assignment-type-ink: #285d4f;
}

.akee-enhanced .assignment-theme-presentation {
  --assignment-type-bg: #f6fdf3;
  --assignment-type-border: #90c77d;
  --assignment-type-ink: #355e2a;
}

.akee-enhanced .assignment-card-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px 12px 8px;
}

.akee-enhanced .assignment-title-line {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.akee-enhanced .assignment-type-badge {
  max-width: 150px;
  overflow: hidden;
  border: 1px solid var(--assignment-type-border, #67b96b);
  border-radius: 999px;
  padding: 4px 11px;
  background: var(--assignment-type-bg, #e4f6e2);
  color: var(--assignment-type-ink, #263c29);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.akee-enhanced .assignment-card .card-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 520px) {
  .akee-enhanced .assignment-title-line { grid-template-columns: minmax(0, 1fr); }
  .akee-enhanced .assignment-type-badge { justify-self: start; }
}

.akee-enhanced .assignment-course {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.akee-enhanced .assignment-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-top: 1px solid var(--akee-line-soft);
  padding: 6px 10px;
  color: var(--akee-muted);
  font-size: 0.7rem;
}

.akee-enhanced .assignment-due-date {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--akee-line);
  border-radius: 6px;
  padding: 4px 7px;
  background: var(--akee-orange-soft);
  color: var(--akee-orange-ink);
  line-height: 1.3;
  white-space: nowrap;
}

.akee-enhanced .assignment-progress-status {
  margin-left: auto;
  border: 1px solid var(--akee-line);
  border-radius: 6px;
  padding: 4px 7px;
  background: var(--akee-neutral-soft);
  color: var(--akee-muted);
  font-size: 0.69rem;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
}

.akee-enhanced .assignment-progress-status[data-tone="success"] {
  background: var(--akee-sage-soft);
  color: var(--akee-success);
}

.akee-enhanced .assignment-progress-status[data-tone="warning"] {
  background: var(--akee-orange-soft);
  color: var(--akee-warning);
}

.akee-enhanced .assignment-progress-status[data-tone="danger"] {
  background: var(--danger-bg);
  color: var(--akee-danger);
}

.akee-enhanced .assignment-due-date .akee-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.akee-enhanced .due-date-label,
.akee-enhanced .due-date-value,
.akee-enhanced .assignment-due-date time {
  font-size: 0.69rem;
  font-weight: 750;
}

.quick-assignment-release-note {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px dashed var(--akee-line-strong);
  border-radius: var(--akee-radius-card);
  padding: 14px 16px;
  background: var(--akee-surface-soft);
}

.quick-assignment-release-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: var(--akee-radius-card);
  background: var(--akee-orange-soft);
  color: var(--akee-orange-ink);
}

.quick-assignment-release-note > span:last-child { display: grid; gap: 2px; }
.quick-assignment-release-note strong { font-size: 0.88rem; }
.quick-assignment-release-note > span:last-child > span { color: var(--muted); font-size: 0.8rem; }

.feature-unavailable-dialog { width: min(440px, calc(100vw - 32px)); }
.feature-unavailable-dialog .dialog-actions { justify-content: flex-end; }

.akee-navigation-dialog { width: min(500px, calc(100vw - 32px)); }
.akee-navigation-dialog .dialog-actions { justify-content: flex-end; }
html[data-akee-revalidating="true"] [data-akee-write-control] {
  cursor: progress;
  opacity: 0.62;
  pointer-events: none;
}

/* Shared file-picking control for all Assignment workflows. */
.akee-enhanced .assignment-file-picker-button,
.assignment-upload-dialog .assignment-file-picker-button,
.report-dialog .assignment-file-picker-button {
  min-height: 44px;
  width: 148px;
  min-width: 148px;
  flex: 0 0 148px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--akee-line-strong);
  border-radius: var(--akee-radius-control);
  padding: 10px 16px;
  background: var(--akee-surface);
  color: var(--akee-ink);
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(82, 54, 41, 0.05);
}

.akee-enhanced .assignment-file-picker-button:hover,
.assignment-upload-dialog .assignment-file-picker-button:hover,
.report-dialog .assignment-file-picker-button:hover {
  border-color: var(--akee-orange);
  background: var(--akee-surface-warm);
  color: var(--akee-orange-ink);
}

.assignment-file-picker-button .akee-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

body.assignment-workflow-page input[type="file"]::file-selector-button {
  min-height: 42px;
  margin-right: 10px;
  border: 1px solid var(--akee-line-strong);
  border-radius: var(--akee-radius-control);
  padding: 9px 14px;
  background: var(--akee-surface);
  color: var(--akee-ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

body.assignment-workflow-page input[type="file"]::file-selector-button:hover {
  border-color: var(--akee-orange);
  background: var(--akee-surface-warm);
  color: var(--akee-orange-ink);
}

/* Desktop application viewport: Header and breadcrumb stay fixed while each work area scrolls alone. */
@media (min-width: 981px) and (min-height: 640px) {
  html.akee-app-viewport,
  html.akee-app-viewport body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell.akee-enhanced {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .akee-enhanced .app-frame {
    height: calc(100dvh - 40px);
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .akee-enhanced .workspace-panel {
    min-height: 0;
    height: 100%;
  }

  .akee-enhanced .side-nav {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  .akee-enhanced .app-column {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .akee-enhanced .page-content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  body.assignment-workflow-page .page-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.assignment-workflow-page .assignment-tool-layout,
  body.assignment-workflow-page .report-layout,
  body.assignment-workflow-page .essay-shell .layout {
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
    align-items: stretch;
  }

  body.assignment-workflow-page .essay-shell .layout { margin-top: 0; }
  body.assignment-workflow-page .essay-shell > .status { flex: 0 0 auto; }

  body.assignment-workflow-page .assignment-tool-rail,
  body.assignment-workflow-page .report-rail,
  body.assignment-workflow-page .essay-shell .sidebar,
  body.assignment-workflow-page .assignment-tool-main,
  body.assignment-workflow-page .report-main,
  body.assignment-workflow-page .essay-shell .content {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  body.assignment-workflow-page .assignment-tool-rail,
  body.assignment-workflow-page .report-rail,
  body.assignment-workflow-page .essay-shell .sidebar {
    position: static;
  }

  .akee-enhanced .side-nav,
  .akee-enhanced .page-content,
  body.assignment-workflow-page .assignment-tool-rail,
  body.assignment-workflow-page .report-rail,
  body.assignment-workflow-page .essay-shell .sidebar,
  body.assignment-workflow-page .assignment-tool-main,
  body.assignment-workflow-page .report-main,
  body.assignment-workflow-page .essay-shell .content {
    scrollbar-width: thin;
    scrollbar-color: var(--akee-line-strong) transparent;
  }

  .akee-enhanced .side-nav::-webkit-scrollbar,
  .akee-enhanced .page-content::-webkit-scrollbar,
  body.assignment-workflow-page .assignment-tool-rail::-webkit-scrollbar,
  body.assignment-workflow-page .report-rail::-webkit-scrollbar,
  body.assignment-workflow-page .essay-shell .sidebar::-webkit-scrollbar,
  body.assignment-workflow-page .assignment-tool-main::-webkit-scrollbar,
  body.assignment-workflow-page .report-main::-webkit-scrollbar,
  body.assignment-workflow-page .essay-shell .content::-webkit-scrollbar {
    width: 8px;
  }

  .akee-enhanced .side-nav::-webkit-scrollbar-thumb,
  .akee-enhanced .page-content::-webkit-scrollbar-thumb,
  body.assignment-workflow-page .assignment-tool-rail::-webkit-scrollbar-thumb,
  body.assignment-workflow-page .report-rail::-webkit-scrollbar-thumb,
  body.assignment-workflow-page .essay-shell .sidebar::-webkit-scrollbar-thumb,
  body.assignment-workflow-page .assignment-tool-main::-webkit-scrollbar-thumb,
  body.assignment-workflow-page .report-main::-webkit-scrollbar-thumb,
  body.assignment-workflow-page .essay-shell .content::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--akee-line-strong);
    background-clip: padding-box;
  }
}

@media (max-width: 980px), (max-height: 639px) {
  .akee-enhanced .top-header {
    position: sticky;
    top: 10px;
  }

  .akee-enhanced .topbar.workspace-toolbar {
    position: sticky;
    z-index: 30;
    top: 78px;
  }
}

.course-assignment-grid { margin-top: 2px; }

@media (max-width: 899px) {
  .akee-enhanced .assignment-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .akee-enhanced .dashboard-welcome { grid-template-columns: 1fr; }
  .akee-enhanced .dashboard-welcome-copy { padding: 24px 20px; }
  .akee-enhanced .dashboard-hero-wrap { min-height: 132px; }
  .akee-enhanced .dashboard-hero-wrap { border-top: 1px solid var(--akee-line); border-left: 0; }
  .akee-enhanced .dashboard-hero { max-height: 116px; }
  .akee-enhanced .section-actions { justify-content: flex-start; }
  .akee-enhanced .course-grid,
  .akee-enhanced .assignment-card-grid { grid-template-columns: 1fr; }
  .akee-enhanced .course-card a { min-height: 82px; }
  .akee-enhanced .assignment-meta { flex-wrap: wrap; }
}

/* Auth pages use the same restrained Academic Minimal surfaces. */
.auth-page {
  width: min(var(--akee-frame-max), calc(100vw - 40px));
  min-height: calc(100vh - 40px);
  margin: 20px auto;
  overflow: hidden;
  border: 1px solid var(--akee-line-soft);
  border-radius: var(--akee-radius-panel);
  background: var(--akee-surface);
  box-shadow: var(--akee-shadow-panel);
}

.auth-context {
  min-height: 100%;
  padding: 48px;
  background: var(--akee-peach-soft);
  color: var(--ink);
}

.auth-context h1 {
  max-width: 420px;
  font-size: 2rem;
  line-height: 1.2;
}

.auth-context p { max-width: 470px; color: var(--muted); }

.auth-form-column {
  min-height: 100%;
  padding: 38px;
  background: var(--akee-surface);
}

.auth-panel h2 { color: var(--ink); font-size: 1.65rem; }
.auth-panel form { display: grid; gap: 4px; }

@media (max-width: 720px) {
  .auth-page {
    width: calc(100vw - 20px);
    min-height: calc(100vh - 20px);
    margin: 10px auto;
    border-radius: 14px;
  }

  .auth-context { min-height: auto; padding: 26px 22px; }
  .auth-context h1 { margin-top: 30px; font-size: 1.55rem; }
  .auth-context p { margin-bottom: 0; }
  .auth-form-column { min-height: auto; padding: 28px 20px; }
  .auth-study-features-entry { top: 20px; }
}
