:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --ink: #242424;
  --muted: #6f6f69;
  --line: #deded8;
  --primary: #3f3f3a;
  --primary-dark: #242424;
  --primary-2: #62625b;
  --accent: #8a7a54;
  --ok: #0f8a65;
  --warn: #a35d00;
  --bad: #b42355;
  --shadow: 0 10px 24px rgba(36, 36, 36, 0.06);
  --grad-main: #3f3f3a;
  --grad-soft: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", sans-serif;
}

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

button {
  border: 1px solid #3f3f3a;
  border-radius: 8px;
  background: var(--grad-main);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 9px 14px;
  box-shadow: none;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  filter: brightness(1.08);
  box-shadow: none;
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.55;
  transform: none;
}

button.secondary {
  border-color: var(--line);
  background: #f2f2ef;
  color: var(--ink);
  box-shadow: none;
}

button.secondary:hover {
  background: #e6e6e1;
}

button.danger {
  border-color: #e5b8bd;
  background: #f7e6e7;
  color: #8a1f2d;
  box-shadow: none;
}

button.danger:hover {
  background: #e9c3bb;
}

button.small {
  min-height: 32px;
  padding: 5px 10px;
}

button.mini {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  min-height: 40px;
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6d6d66;
  box-shadow: 0 0 0 3px rgba(36, 36, 36, 0.08);
  outline: none;
}

textarea {
  min-height: 260px;
  resize: vertical;
  white-space: pre;
  overflow: auto;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.marketing-site {
  background: #fbfbf8;
  min-height: 100vh;
}

.marketing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 20px clamp(16px, 4vw, 56px);
}

.marketing-nav strong {
  font-size: 20px;
}

.marketing-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 0.85fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: 56px clamp(16px, 4vw, 56px) 46px;
}

.hero-copy h1 {
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.12;
  margin: 0 0 18px;
  max-width: 820px;
}

.hero-copy p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
  margin: 0 0 22px;
  max-width: 640px;
}

.hero-points {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 26px 0;
  max-width: 640px;
  padding: 18px 0 0;
}

.hero-points li {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.product-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f5;
  box-shadow: none;
  padding: 16px;
}

.preview-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.preview-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d9d9d2;
}

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

.preview-day {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 14px;
}

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

.preview-day.available {
  background: #ecfdf5;
  border-left-color: #10b981;
}

.preview-day.unavailable {
  background: #fff1f2;
  border-left-color: #e11d48;
}

.preview-day.late {
  background: #eff6ff;
  border-left-color: #2563eb;
}

.preview-day.either {
  background: #f5f3ff;
  border-left-color: #8b5cf6;
}

.story-section,
.pricing-section {
  padding: 34px clamp(16px, 4vw, 56px) 64px;
}

.story-section {
  display: grid;
  gap: 0;
  margin: 0 auto;
  max-width: 1040px;
}

.price-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.story-row {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: clamp(18px, 4vw, 54px);
  padding: 42px 0;
}

.story-row:last-child {
  border-bottom: 1px solid var(--line);
}

.story-number {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  padding-top: 8px;
}

.story-row h2 {
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.2;
  margin: 0 0 14px;
}

.story-row p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
  margin: 0;
  max-width: 720px;
}

.price-card h3,
.section-heading h2 {
  margin: 0;
}

.price-card p {
  color: var(--muted);
  line-height: 1.65;
}

.section-heading {
  margin-bottom: 16px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.price-card {
  display: grid;
  gap: 12px;
}

.price-card.featured {
  border-color: #77776f;
  box-shadow: inset 0 0 0 1px #77776f;
}

.price {
  color: var(--ink) !important;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1 !important;
  margin: 0 !important;
}

.price span {
  color: var(--muted);
  font-size: 14px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(16px, 3vw, 36px) 18px;
}

.app-header h1,
.panel h2,
.toolbar h2 {
  margin: 0;
}

.app-header h1 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.2;
}

.billing-pill {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 7px 0 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: #595953;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-actions,
.button-row,
.panel-title-row,
.toolbar,
.add-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 18px;
  padding: 0 clamp(16px, 3vw, 36px) 32px;
}

.sidebar,
.workspace {
  min-width: 0;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel h2 {
  font-size: 18px;
}

.panel-title-row {
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel > label + label,
.panel > label + .hint,
.staff-list + .add-row {
  margin-top: 12px;
}

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

.staff-list {
  display: grid;
  gap: 8px;
}

.staff-list-header {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(112px, 140px) auto;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.staff-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(112px, 140px) auto;
  gap: 8px;
}

.add-row {
  align-items: stretch;
}

.add-row button {
  width: 84px;
}

.cutoff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.billing-banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.billing-banner p {
  color: var(--muted);
  margin: 3px 0 0;
}

.billing-banner.expired,
.billing-banner.none {
  border-color: #fda4af;
  background: #fff1f2;
}

.billing-banner.trial {
  border-color: #d3d0c6;
  background: #f7f4ea;
}

.billing-banner.active,
.billing-banner.partner {
  border-color: #86efac;
  background: #ecfdf5;
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
}

.subscription-card {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.subscription-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

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

.subscription-status.active {
  background: #ecfdf5;
  border-color: #86efac;
}

.subscription-status.trial {
  background: #f7f4ea;
  border-color: #d3d0c6;
}

.subscription-status.partner {
  background: #ecfdf5;
  border-color: #86efac;
}

.subscription-status.expired,
.subscription-status.none {
  background: #fff1f2;
  border-color: #fda4af;
}

.subscription-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.subscription-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.subscription-card dt {
  color: var(--muted);
}

.subscription-card dd {
  font-weight: 800;
  margin: 0;
}

.checkout-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.partner-panel {
  grid-column: 1 / -1;
}

.partner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 12px;
}

.tab {
  border-color: var(--line);
  background: #f0f0ec;
  color: var(--ink);
  box-shadow: none;
  white-space: nowrap;
}

.tab.active {
  background: #3f3f3a;
  color: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hidden {
  display: none !important;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.toolbar > label,
.toolbar > input {
  max-width: 320px;
}

.month-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.entry-grid,
.calendar-grid {
  display: grid;
  gap: 12px;
}

.entry-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.calendar-grid {
  grid-template-columns: repeat(7, minmax(230px, 1fr));
  overflow-x: auto;
  padding-bottom: 6px;
}

.calendar-weekday {
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px 6px;
  text-align: center;
}

.calendar-blank {
  min-height: 1px;
}

.day-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  min-width: 230px;
  position: relative;
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.day-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
}

.day-card > * {
  position: relative;
}

.day-card:hover {
  border-color: #8d8d84;
  box-shadow: 0 10px 22px rgba(36, 36, 36, 0.08);
  transform: translateY(-1px);
}

.day-card.day-available {
  border-color: #86efac;
  background: #ecfdf5;
}

.day-card.day-available::before {
  opacity: 1;
  background: #10b981;
  right: auto;
  width: 5px;
}

.day-card.day-unavailable {
  border-color: #fda4af;
  background: #fff1f2;
}

.day-card.day-unavailable::before {
  opacity: 1;
  background: #e11d48;
  right: auto;
  width: 5px;
}

.day-card.day-morning {
  border-color: #fcd34d;
  background: #fffbeb;
}

.day-card.day-morning::before {
  opacity: 1;
  background: #f59e0b;
  right: auto;
  width: 5px;
}

.day-card.day-late {
  border-color: #93c5fd;
  background: #eff6ff;
}

.day-card.day-late::before {
  opacity: 1;
  background: #2563eb;
  right: auto;
  width: 5px;
}

.day-card.day-either {
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.day-card.day-either::before {
  opacity: 1;
  background: #8b5cf6;
  right: auto;
  width: 5px;
}

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 800;
}

.weekday {
  color: var(--muted);
  font-size: 12px;
}

.day-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.entry-fields {
  display: grid;
  gap: 8px;
}

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

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  min-height: 32px;
  padding: 5px 9px;
}

.radio-row label:has(input:checked) {
  border-color: #63635c;
  background: #eeeeea;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(36, 36, 36, 0.08);
}

.radio-row input {
  width: auto;
  min-height: auto;
}

.day-card textarea {
  min-height: 58px;
  white-space: normal;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 190px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f0f0ec;
  z-index: 1;
  font-size: 12px;
}

.status {
  display: inline-block;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.status.ok {
  background: #dcefe3;
  color: var(--ok);
}

.status.ng {
  background: #f3dddd;
  color: var(--bad);
}

.status.maybe {
  background: #f6ead7;
  color: var(--warn);
}

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

.invite-warning {
  border: 1px solid #e3c277;
  border-radius: 8px;
  background: #fff6df;
  color: #684600;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 14px;
  padding: 12px;
}

.invite-list {
  display: grid;
  gap: 12px;
}

.invite-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.invite-card h3 {
  margin: 0;
}

.invite-url {
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf7;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 9px;
}

.featured-select {
  border: 1px solid #b9b9b0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(36, 36, 36, 0.08);
  color: var(--ink);
  min-width: 260px;
  padding: 10px;
}

.featured-select select {
  border-color: #77776f;
  font-size: 16px;
  font-weight: 800;
}

.staff-portal {
  padding: 18px;
}

.staff-shell {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 980px;
}

.staff-hero {
  padding: 10px 0 2px;
}

.staff-hero h1 {
  font-size: clamp(24px, 7vw, 38px);
  line-height: 1.2;
  margin: 0;
}

.staff-portal .panel {
  box-shadow: none;
}

.staff-portal .toolbar {
  align-items: flex-start;
}

.print-area {
  display: none;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: #222;
  color: #fff;
  padding: 11px 14px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 880px) {
  .app-header,
  .toolbar,
  .header-actions,
  .marketing-nav,
  .marketing-actions,
  .hero-actions,
  .billing-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .layout,
  .export-grid,
  .hero-section,
  .pricing-grid,
  .billing-layout {
    grid-template-columns: 1fr;
  }

  .story-row,
  .partner-grid {
    grid-template-columns: 1fr;
  }

  .toolbar > label,
  .toolbar > input {
    max-width: none;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 120px;
  }
}

@media (max-width: 640px) {
  .calendar-grid {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .calendar-weekday,
  .calendar-blank {
    display: none;
  }

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

  .staff-list-header,
  .staff-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  body > *:not(.print-area) {
    display: none !important;
  }

  .print-area {
    display: block;
    color: #000;
    font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  }

  .print-area h1 {
    font-size: 20px;
    margin: 0 0 12px;
  }

  .print-day {
    break-inside: avoid;
    border-top: 2px solid #000;
    padding: 10px 0;
  }

  .print-area table {
    min-width: 0;
    width: 100%;
  }

  .print-area th,
  .print-area td {
    border: 1px solid #888;
    font-size: 11px;
    padding: 5px;
  }
}
