:root {
  --bg: #0f111c;
  --panel: #191c2b;
  --panel-strong: #22263a;
  --ink: #fbf7ff;
  --muted: #aaa8b9;
  --line: rgba(255, 255, 255, 0.12);
  --mint: #32efc3;
  --yellow: #ffe567;
  --pink: #ff58ce;
  --blue: #66aaff;
  --danger: #ff5472;
  --done: #62d98f;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 88, 206, 0.08), transparent 34%),
    linear-gradient(215deg, rgba(50, 239, 195, 0.07), transparent 38%),
    linear-gradient(180deg, #0f111c 0%, #121525 58%, #0e1019 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 18px;
  width: min(100%, 1380px);
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.sidebar,
.main,
.panel,
.modal {
  background: rgba(25, 28, 43, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - 36px);
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 950;
}

.brand img {
  width: 42px;
  height: 42px;
}

.tagline {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin-top: 24px;
}

.nav button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  text-align: left;
  font-weight: 900;
}

.nav button.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
}

.nav span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #10121f;
  background: var(--yellow);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 950;
}

.nav em {
  min-width: 26px;
  padding: 2px 7px;
  color: #10121f;
  background: var(--mint);
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-style: normal;
}

.nav strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-note {
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.privacy-note strong {
  display: block;
  font-size: 13px;
}

.privacy-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.privacy-note a {
  display: inline-flex;
  margin-top: 10px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
}

.main {
  min-width: 0;
  min-height: calc(100vh - 36px);
  padding: clamp(16px, 3vw, 28px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar > div {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: 0;
}

#pageSubhead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.top-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 10px;
}

.top-actions {
  justify-content: flex-end;
}

.launch-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(102, 170, 255, 0.08);
  border: 1px solid rgba(102, 170, 255, 0.18);
  border-radius: 12px;
  min-width: 0;
}

body[data-view]:not([data-view="capture"]) .launch-strip,
body[data-view="week"] .next-panel,
body[data-view="all"] .next-panel,
body[data-view="settings"] .next-panel {
  display: none;
}

.launch-strip strong {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.launch-strip span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.launch-strip .small-button {
  flex: 0 0 auto;
}

.next-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(50, 239, 195, 0.11), rgba(255, 229, 103, 0.07));
  border: 1px solid rgba(50, 239, 195, 0.22);
  border-radius: 12px;
  min-width: 0;
}

.next-panel h2 {
  margin: 0 0 6px;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.08;
}

.next-panel p:last-child {
  margin: 0;
  color: var(--muted);
}

.next-panel .button {
  min-width: 150px;
}

.button,
.small-button,
.prompt-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 950;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}

.button.primary {
  color: #10121f;
  background: var(--yellow);
  border-color: transparent;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.34);
}

.button.mint {
  color: #10121f;
  background: var(--mint);
  border-color: transparent;
}

.button.danger {
  background: rgba(255, 84, 114, 0.18);
  border-color: rgba(255, 84, 114, 0.42);
}

.small-button {
  min-height: 34px;
  padding-inline: 10px;
  color: #10121f;
  background: var(--mint);
  border-color: transparent;
  font-size: 12px;
}

.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.capture-actions {
  margin-top: 10px;
}

.review-actions {
  margin-top: 2px;
}

.prompt-chip {
  min-height: 34px;
  padding-inline: 10px;
  background: rgba(102, 170, 255, 0.12);
  border-color: rgba(102, 170, 255, 0.28);
  font-size: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.52fr);
  gap: 18px;
}

.capture-workspace {
  max-width: 860px;
}

.stack,
.review-list,
.task-list,
.class-list,
.week-list,
.plan-list,
.step-list {
  display: grid;
  gap: 12px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2 {
  min-width: 0;
  margin: 0;
  font-size: 19px;
}

.pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  color: var(--mint);
  background: rgba(50, 239, 195, 0.1);
  border: 1px solid rgba(50, 239, 195, 0.25);
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 950;
}

textarea,
input,
select {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}

textarea {
  min-height: 138px;
  padding: 14px;
  resize: vertical;
}

input,
select {
  min-height: 42px;
  padding: 0 11px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(50, 239, 195, 0.72);
  box-shadow: 0 0 0 4px rgba(50, 239, 195, 0.12);
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ai-note a {
  color: var(--mint);
  font-weight: 950;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.pro-panel {
  border-color: rgba(50, 239, 195, 0.2);
}

.pro-benefits {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.pro-benefits div {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pro-benefits strong {
  display: block;
  margin-bottom: 4px;
}

.pro-benefits span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.pro-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.pro-actions .button,
.pro-secondary-actions .button {
  width: 100%;
}

.pro-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-grid div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.stat-grid strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stat-grid span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.meter {
  height: 13px;
  margin-top: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.11);
  border-radius: 999px;
}

.meter span {
  display: block;
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--yellow), var(--danger));
  border-radius: inherit;
}

.empty,
.review-card,
.task-card,
.class-card,
.day-group,
.plan-step {
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.empty {
  color: var(--muted);
  border-style: dashed;
}

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

.review-grid {
  grid-template-columns: minmax(170px, 1.3fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr);
}

.full {
  grid-column: 1 / -1;
}

.task-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.task-card > div:nth-child(2) {
  min-width: 0;
}

.task-card.done {
  opacity: 0.62;
}

.task-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #10121f;
  background: var(--blue);
  border-radius: 13px;
  font-weight: 950;
}

.task-card.test .task-icon {
  background: var(--danger);
}

.task-card.study .task-icon {
  background: var(--pink);
}

.task-card.work_shift .task-icon {
  background: var(--mint);
}

.task-card.appointment .task-icon,
.task-card.reminder .task-icon {
  background: var(--yellow);
}

.task-title {
  margin: 0;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.meta-chip {
  padding: 2px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.meta-chip.ai,
.source-badge.ai {
  color: #10121f;
  background: var(--mint);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 26px;
  margin-bottom: 10px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.step-button {
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 950;
}

.step-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.step-row span {
  overflow-wrap: anywhere;
}

.step-row.done {
  opacity: 0.58;
}

.step-row.done span {
  text-decoration: line-through;
}

.step-button.done {
  color: #10121f;
  background: var(--done);
  border-color: transparent;
}

.day-group h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.plan-step {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
}

.plan-time {
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
}

.plan-step strong {
  display: block;
  margin-bottom: 4px;
}

.plan-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.export-box {
  min-height: 170px;
  margin-top: 12px;
  font-size: 12px;
}

#feedbackMessage {
  min-height: 150px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
}

.modal-backdrop.active {
  display: grid;
}

.modal {
  width: min(100%, 650px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 18px;
}

.modal h2 {
  margin-bottom: 14px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.onboarding-modal {
  width: min(100%, 700px);
}

.onboarding-modal h2 {
  margin-bottom: 8px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1;
}

.onboarding-copy {
  max-width: 560px;
  color: var(--muted);
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.onboarding-grid article {
  min-height: 108px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.onboarding-grid strong {
  display: block;
  margin-bottom: 8px;
}

.onboarding-grid span {
  color: var(--muted);
  font-size: 13px;
}

.legal-page {
  width: min(100% - 28px, 820px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
}

.legal-page .brand {
  margin-bottom: 18px;
}

.legal-panel {
  padding: clamp(20px, 4vw, 34px);
}

.legal-panel h1 {
  max-width: 680px;
}

.legal-panel h2 {
  margin: 26px 0 8px;
  font-size: 18px;
}

.legal-panel p,
.legal-panel li {
  color: var(--muted);
}

.legal-panel a:not(.button) {
  color: var(--mint);
  font-weight: 900;
}

.legal-panel ul {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  padding-left: 20px;
}

.support-actions {
  margin: 18px 0 24px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  }

  .privacy-note {
    display: none;
  }

  .layout-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    background: linear-gradient(180deg, #0f111c 0%, #121525 62%, #0e1019 100%);
  }

  .app-shell {
    gap: 10px;
    padding: 0 10px 10px;
  }

  .main,
  .sidebar,
  .panel,
  .modal {
    border-radius: 13px;
  }

  .main,
  .sidebar {
    padding: 14px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-inline: -10px;
    padding: 10px 10px 12px;
    background: rgba(15, 17, 28, 0.96);
    border-radius: 0 0 16px 16px;
    backdrop-filter: blur(18px);
  }

  .brand {
    gap: 9px;
    font-size: 17px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .tagline {
    margin-top: 6px;
    font-size: 12px;
  }

  .topbar {
    flex-direction: column;
    gap: 14px;
  }

  .next-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .launch-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .launch-strip .small-button {
    width: 100%;
  }

  .next-panel .button {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .top-actions .button {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
  }

  .capture-workspace {
    max-width: none;
  }

  .prompt-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .prompt-chip {
    width: 100%;
    padding-inline: 8px;
    font-size: 11px;
  }

  .capture-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }

  .capture-actions .button {
    width: 100%;
    padding-inline: 10px;
  }

  .capture-actions #smartExtractButton {
    grid-column: 1 / -1;
  }

  .review-actions {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  .review-actions .button {
    width: 100%;
  }

  .nav {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    flex: 0 0 92px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 5px 6px;
    min-height: 68px;
    padding: 8px;
    text-align: center;
  }

  .nav span {
    justify-self: center;
    grid-column: 1 / -1;
    width: 28px;
    height: 28px;
  }

  .nav strong {
    justify-self: start;
    font-size: 12px;
  }

  .nav em {
    justify-self: end;
    min-width: 23px;
    padding-inline: 6px;
  }

  .review-grid,
  .form-grid,
  .plan-step,
  .onboarding-grid,
  .inline-field {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .pro-actions,
  .pro-secondary-actions {
    grid-template-columns: 1fr;
  }

  .stat-grid div {
    padding: 12px 10px;
  }

  .stat-grid strong {
    font-size: 24px;
  }

  .stat-grid span {
    font-size: 11px;
  }

  .task-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .icon-button {
    width: 100%;
  }

  .step-row {
    grid-template-columns: 64px 1fr;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    padding: 16px;
  }

  .onboarding-modal h2 {
    font-size: 30px;
  }

  .onboarding-grid {
    gap: 8px;
    margin-top: 14px;
  }

  .onboarding-grid article {
    min-height: auto;
    padding: 12px;
  }
}
