@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@1,500;1,600&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500&family=Noto+Serif+SC:wght@500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #13100C;
  --panel: rgba(28, 24, 17, .9);
  --panel-soft: rgba(28, 24, 17, .76);
  --panel-deep: rgba(19, 16, 12, .82);
  --ink: #E8DFD0;
  --muted: #A99D8C;
  --line: rgba(232, 223, 208, .18);
  --line-strong: rgba(232, 223, 208, .34);
  --accent: #B9822B;
  --warning: #C8472D;
  --cyan: #4F9780;
  --red: var(--warning);
  --shadow: none;
  --grid-x: rgba(232, 223, 208, .025);
  --grid-y: rgba(232, 223, 208, .018);
  --accent-wash: rgba(185, 130, 43, .08);
  --top-wash: rgba(232, 223, 208, .035);
  --hover-bg: rgba(232, 223, 208, .035);
  --field-bg: rgba(19, 16, 12, .5);
  --toolbar-bg: rgba(19, 16, 12, .92);
  --placeholder: rgba(232, 223, 208, .42);
  --accent-button: rgba(185, 130, 43, .16);
  --card-highlight: rgba(232, 223, 208, .085);
  --card-soft: rgba(232, 223, 208, .014);
  --card-shadow: rgba(19, 16, 12, .42);
  --card-base: rgba(19, 16, 12, .34);
  --card-outside-highlight: rgba(232, 223, 208, .045);
  --card-outside-base: rgba(19, 16, 12, .24);
  --card-has-accent: rgba(185, 130, 43, .065);
  --card-has-base: rgba(185, 130, 43, .08);
  --card-selected-accent: rgba(79, 151, 128, .12);
  --card-selected-base: rgba(79, 151, 128, .1);
  --inner-light: rgba(255, 255, 255, .12);
  --inner-soft: rgba(255, 255, 255, .045);
  --inner-border: rgba(255, 255, 255, .055);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  box-shadow: none !important;
  text-shadow: none !important;
}

html,
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  font-weight: 300;
  line-height: 1.72;
  background:
    repeating-linear-gradient(90deg, var(--grid-x) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, var(--grid-y) 0 1px, transparent 1px 96px),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 69%, var(--accent-wash) 69% 69.15%, transparent 69.15%),
    linear-gradient(180deg, var(--top-wash), transparent 38%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23noise)' opacity='.72'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

button,
input,
textarea,
.eyebrow,
.stats span,
.stats strong,
.toolbar,
.panel-head span,
.weekdays,
.day-number,
.day-count,
.day-item,
.day-item-time,
.day-item-title,
.more-count,
.course-time,
.course-title,
.course-meta,
.editor-form label span,
.weekday-picker,
.theme-form,
.theme-presets,
.empty {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .075em;
  font-variant-numeric: tabular-nums;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: .075em;
}

button {
  position: relative;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 15px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}

button::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--hover-bg);
}

button:hover::after {
  transform: scaleX(1);
}

button.primary {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-button);
}

button.ghost {
  height: 32px;
  padding: 0 10px;
}

button.danger {
  color: var(--warning);
  border-color: rgba(200, 71, 45, .5);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field-bg);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--hover-bg);
}

input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

textarea {
  resize: vertical;
}

.is-hidden {
  display: none !important;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 72px));
  margin: 0 auto;
  padding: 64px 0 84px;
}

.login-view {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-box {
  position: relative;
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-bottom-style: dashed;
  border-radius: 2px;
  background: var(--panel);
}

.login-box::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 68px;
  border-top: 1px dashed var(--line-strong);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.35;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", STSong, Georgia, serif;
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  max-width: 9em;
  font-size: clamp(44px, 6vw, 82px);
  line-height: .98;
}

h1::after {
  content: " / Schedule Ledger";
  display: block;
  margin-top: 12px;
  color: var(--accent);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(22px, 2.8vw, 38px);
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .02em;
}

h2 {
  font-size: 24px;
  line-height: 1.18;
}

.error-text {
  min-height: 20px;
  margin: 0;
  color: var(--warning);
  font-size: 12px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
  gap: clamp(28px, 6vw, 92px);
  align-items: start;
  margin-bottom: 34px;
  padding: 0 94px 36px 0;
  border-bottom: 1px solid var(--line);
}

.topbar::before {
  content: "REMOTE\A 2026";
  white-space: pre;
  position: absolute;
  top: 4px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid var(--warning);
  outline: 1px dashed rgba(200, 71, 45, .48);
  outline-offset: -6px;
  color: var(--warning);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 600;
  line-height: .86;
  letter-spacing: .08em;
  text-align: center;
  transform: rotate(-10deg);
  opacity: .78;
  pointer-events: none;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  border-bottom: 1px dashed var(--line-strong);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-self: start;
}

.stats div,
.calendar-panel,
.day-panel,
.editor-panel,
.theme-panel,
.bulk-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel-soft);
  overflow: hidden;
}

.calendar-panel {
  overflow: auto;
}

.stats div {
  min-height: 128px;
  padding: 18px;
  border-bottom-style: dashed;
  background: var(--panel);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.stats div::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  border-top: 1px solid var(--accent);
}

.stats div:nth-child(2)::before {
  border-color: var(--cyan);
}

.stats div:nth-child(3)::before {
  border-color: var(--warning);
}

.stats div:hover,
.day-cell:hover,
.course-row:hover,
.day-item:hover,
.theme-button:hover,
.weekday-picker label:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.stats span {
  display: block;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 11px;
}

.stats strong {
  display: block;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 600;
  line-height: 1;
}

.toolbar {
  position: static;
  z-index: 10;
  display: grid;
  grid-template-columns: 160px minmax(220px, 1fr) repeat(3, auto);
  gap: 9px;
  align-items: center;
  margin: 28px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-bottom-style: dashed;
  border-radius: 2px;
  background: var(--toolbar-bg);
}

.toolbar input,
.toolbar button {
  height: 42px;
  font-size: 12px;
  font-weight: 500;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 24px;
  align-items: start;
}

.calendar-panel::before,
.day-panel::before,
.editor-panel::before,
.theme-panel::before,
.bulk-panel::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 54px;
  border-top: 1px dashed var(--line-strong);
  pointer-events: none;
}

.panel-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 11px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 1120px;
  gap: 8px;
  padding: 8px 18px 0;
}

.weekdays span {
  padding: 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
  min-width: 1120px;
  gap: 8px;
  padding: 8px 18px 20px;
}

.day-cell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  min-height: 184px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(145deg, var(--card-highlight), var(--card-soft) 42%, var(--card-shadow)),
    var(--card-base);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.day-cell::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border: 1px solid var(--inner-border);
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, var(--inner-light), transparent 34%),
    linear-gradient(315deg, var(--inner-soft), transparent 42%);
  opacity: .5;
}

.day-cell > * {
  position: relative;
  z-index: 1;
}

.day-cell.outside {
  opacity: .42;
  background:
    linear-gradient(145deg, var(--card-outside-highlight), var(--card-soft)),
    var(--card-outside-base);
}

.day-cell.has-items {
  background:
    linear-gradient(145deg, var(--card-highlight), var(--card-has-accent) 42%, var(--card-shadow)),
    var(--card-has-base);
}

.day-cell.selected {
  border-color: var(--cyan);
  background:
    linear-gradient(145deg, var(--card-highlight), var(--card-selected-accent) 44%, var(--card-shadow)),
    var(--card-selected-base);
  outline: none;
}

.day-cell.today {
  border-color: var(--warning);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 42%, transparent);
}

.day-cell.today .day-number {
  color: var(--warning);
}

.day-top {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
}

.day-number {
  min-width: 30px;
  height: 30px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 30px;
}

.day-cell.has-items .day-number {
  color: var(--accent);
}

.today-marker {
  margin-right: auto;
  padding: 3px 7px;
  border: 1px solid var(--warning);
  color: var(--warning);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.day-count {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
  line-height: 22px;
}

.day-items {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.day-cell:hover .day-items,
.day-cell:focus .day-items,
.day-cell:focus-visible .day-items {
  overflow-y: visible;
}

.day-items::-webkit-scrollbar {
  width: 5px;
}

.day-items::-webkit-scrollbar-track {
  background: transparent;
}

.day-items::-webkit-scrollbar-thumb {
  background: rgba(185, 130, 43, .55);
  border-radius: 8px;
}

.day-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  width: 100%;
  min-height: 38px;
  overflow: visible;
  border: 1px solid var(--course-border, rgba(185, 130, 43, .5));
  border-left: 3px solid var(--course);
  border-radius: 2px;
  padding: 7px 8px;
  color: var(--ink);
  background: var(--course-bg);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.day-item-time {
  color: var(--course);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.day-item-title {
  color: var(--ink);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.more-count {
  color: var(--muted);
  font-size: 10px;
}

.side-panel {
  display: grid;
  gap: 18px;
}

.day-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.course-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--course-border, rgba(185, 130, 43, .5));
  border-left: 3px solid var(--course);
  border-radius: 2px;
  background: var(--course-bg);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.course-row:focus-visible {
  outline: 2px solid var(--course);
  outline-offset: 2px;
}

.course-time {
  color: var(--course);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.course-title {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.course-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.editor-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.editor-form label {
  display: grid;
  gap: 6px;
}

.editor-form label span {
  color: var(--muted);
  font-size: 11px;
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.theme-panel,
.bulk-panel {
  overflow: hidden;
}

.theme-panel summary,
.bulk-panel summary {
  position: relative;
  cursor: pointer;
  padding: 20px 18px 16px;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", STSong, Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.18;
}

.theme-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 14px 0;
}

.theme-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  height: auto;
  padding: 9px 10px;
  text-align: left;
}

.theme-button.is-active {
  border-color: var(--cyan);
  background: var(--card-selected-base);
}

.theme-button strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.theme-swatches {
  display: flex;
  gap: 4px;
}

.theme-swatches i {
  width: 13px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.theme-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

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

.theme-grid label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 6px 7px 6px 10px;
  background: var(--field-bg);
}

.theme-grid label span {
  color: var(--muted);
  font-size: 11px;
}

.theme-grid input[type="color"] {
  width: 38px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0;
  background: transparent;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.weekday-picker label {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  background: var(--field-bg);
  font-size: 11px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  background: var(--field-bg);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1180px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding-right: 0;
  }

  .topbar::before {
    top: 2px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 24px, 1480px);
    padding-top: 34px;
  }

  .topbar {
    padding-bottom: 28px;
  }

  .topbar::before {
    display: none;
  }

  h1 {
    font-size: 42px;
  }

  h1::after {
    font-size: 22px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stats div {
    min-height: 92px;
    padding: 14px 16px;
  }

  .stats span {
    margin-bottom: 16px;
  }

  .stats strong {
    font-size: 34px;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar input {
    grid-column: 1 / -1;
  }

  .toolbar button {
    width: 100%;
  }

  .calendar-panel {
    overflow: auto;
  }

  .weekdays,
  .calendar-grid {
    min-width: 1050px;
  }

  .calendar-grid {
    padding-left: 10px;
    padding-right: 10px;
  }

  .weekdays {
    padding-left: 10px;
    padding-right: 10px;
  }

  .course-row {
    grid-template-columns: 1fr auto;
  }

  .course-time {
    grid-column: 1 / -1;
  }

  .field-row,
  .theme-grid,
  .weekday-picker {
    grid-template-columns: 1fr;
  }
}
