:root {
  /* Light theme is default */
  --bg: #f5f2ec;
  --bg-elevated: #ffffff;
  --bg-lighter: #ece4d8;
  --paper: #ffffff;
  --line: rgba(0, 0, 0, 0.06);
  --text: #28231d;
  --muted: #756c61;
  --accent: #4f7fff;
  --accent-soft: rgba(79, 127, 255, 0.12);
  --danger: #c62828;
  --radius: 16px;
}

/* Dark theme when explicit */
html.dark {
  --bg: #05060a;
  --bg-elevated: #10121a;
  --bg-lighter: #1a1c27;
  --paper: #161821;
  --line: rgba(255, 255, 255, 0.04);
  --text: #f4f3ef;
  --muted: #b7b3aa;
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Sabon", "Garamond", "Georgia", serif;
}

/* App shell */
.app {
  width: 100%;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border-radius: 0;
  padding: 12px 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
  .shell {
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 24px;
    padding: 18px 20px 18px;
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(0, 0, 0, 0.04);
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo mark – uses background image if you set one */
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: url("logo.png") center/contain no-repeat,
    linear-gradient(135deg, #4f7fff, #9f7fff);
}

/* Remove old glowing dot */
.app-dot {
  display: none;
}

.header h1 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.subtitle {
  display: none; /* removed per request */
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-cluster {
  display: flex;
  align-items: center;
}

/* Auth UI */
.user-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 8px;
}

.auth-btn {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.8rem;
  margin-left: 8px;
  cursor: pointer;
}

/* Settings icon button */
.settings-toggle {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Settings side drawer */
.settings-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: 280px;
  max-width: 80%;
  background: var(--bg-elevated);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.24s ease-out;
  z-index: 40;
}

.settings-drawer.open {
  transform: translateX(0);
}

.settings-drawer-inner {
  padding: 16px 16px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.settings-drawer-header h2 {
  font-size: 1rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.settings-close {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: transparent;
  color: var(--text);
  padding: 4px 9px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Backdrop */
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 30;
}

.settings-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Settings groups */
.settings-group {
  border-radius: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--paper);
}

.settings-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 4px;
}

.settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-chip {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  padding: 4px 10px;
  cursor: pointer;
}

.settings-chip--active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.settings-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

/* Layout */
.main-layout {
  display: grid;
  gap: 16px;
  padding-top: 4px;
}

@media (min-width: 880px) {
  .main-layout {
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  }
}

/* Notebook panel */
.notebook {
  position: relative;
}

.notebook-rings {
  position: absolute;
  left: 14px;
  top: 16px;
  bottom: 16px;
  width: 12px;
  background: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, 0.06) 14%,
    rgba(0, 0, 0, 0.06) 86%,
    transparent 100%
  );
  border-radius: 999px;
  opacity: 0.8;
}

.notebook-inner {
  background: var(--paper);
  border-radius: 24px;
  padding: 16px 16px 12px 32px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}

.notebook-inner::before {
  content: "";
  position: absolute;
  left: 56px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.06);
}

.notebook-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 22px,
    var(--line) 23px
  );
  pointer-events: none;
  opacity: 0.8;
}

.notebook-header,
.task-input-row,
.class-bar,
.sections,
.notebook-footer {
  position: relative;
  z-index: 1;
}

/* Notebook header */
.notebook-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.nh-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nh-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.nh-date {
  font-size: 0.95rem;
}

.nh-counter {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Task input row */
.task-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) auto auto;
  grid-template-rows: auto auto;
  gap: 6px;
  margin-bottom: 8px;
}

.task-input,
.task-date,
.task-class-select {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
  color: var(--text);
  font-size: 0.9rem;
  padding: 8px 10px;
  font-family: inherit;
}

.task-input::placeholder,
.class-input::placeholder {
  color: rgba(117, 108, 97, 0.9);
}

.task-date {
  min-width: 120px;
}

.task-date-label {
  align-self: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.task-class-select {
  min-width: 120px;
}

.add-btn {
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* Class bar */
.class-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.class-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.class-chip {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  font-size: 0.75rem;
  padding: 4px 9px;
  background: rgba(0, 0, 0, 0.02);
  color: var(--text);
  cursor: pointer;
}

.class-chip--active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.class-add-row {
  display: flex;
  gap: 6px;
}

.class-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
  color: var(--text);
  font-size: 0.85rem;
  padding: 7px 10px;
  font-family: inherit;
}

.class-add-btn {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: transparent;
  color: var(--text);
  padding: 7px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Sections */
.sections {
  display: grid;
  gap: 8px;
}

.section {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 16px;
  padding: 8px 10px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 4px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.section-empty {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Task items */
.task {
  display: flex;
  margin: 3px 0;
}

.task-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.task-checkbox {
  margin-top: 2px;
}

.task-body {
  flex: 1;
}

.task-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.task-text {
  font-size: 0.9rem;
}

.task-meta-line {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.task-class {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.task-due {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
}

.task--done .task-text {
  text-decoration: line-through;
  opacity: 0.7;
}

.task--overdue .task-text {
  color: var(--danger);
}

/* Notebook footer */
.notebook-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 6px;
  gap: 8px;
}

.clear-btn {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.hint-text {
  display: none; /* removed */
}

/* Notes panel */
.notes-panel {
  background: var(--bg-elevated);
  border-radius: 24px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-header {
  display: flex;
  flex-direction: column;
}

.notes-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.notes-tagline {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.notes-area {
  flex: 1;
  min-height: 180px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--bg-lighter);
  color: var(--text);
  padding: 8px 10px;
  resize: vertical;
  font-size: 0.9rem;
  font-family: inherit;
}

.notes-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 720px) {
  .shell {
    padding: 12px 10px 14px;
    border-radius: 0;
    box-shadow: none;
  }

  .header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .header-right {
    margin-left: auto;
  }

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

  .notebook-inner {
    padding-left: 20px;
  }

  .notebook-rings {
    display: none;
  }

  .notes-panel {
    margin-top: 8px;
  }
}
