:root {
  color-scheme: light;
  --bg: #f3f2ef;
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f0ed;
  --ink: #121411;
  --line: #222222;
  --ui-line: #dfddd7;
  --muted: #6b6f67;
  --grid: rgba(0, 0, 0, 0.055);
  --accent: #f15a1a;
  --accent-2: #fff0e7;
  --black: #050504;
  --green: #1f7a4d;
  --green-2: #dff1e8;
  --shadow: 0 18px 42px rgba(18, 20, 17, 0.08);
  --sheet-width: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 12% 4%, rgba(241, 90, 26, 0.1), transparent 24rem),
    linear-gradient(180deg, #f7f6f4 0%, var(--bg) 34rem);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-width: 320px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.planner-tabs {
  display: none;
}

.planner-topbar {
  align-items: center;
  background: rgba(247, 246, 244, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(223, 221, 215, 0.72);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 42px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-lockup {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(18, 20, 17, 0.08);
  display: block;
  height: 54px;
  object-fit: contain;
  padding: 5px;
  width: 54px;
}

.brand-lockup strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1.1;
}

.eyebrow {
  color: var(--accent);
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.planner-main {
  padding: clamp(16px, 3.4vw, 36px) clamp(16px, 4vw, 42px) clamp(28px, 5vw, 54px);
}

.sheet-wrap {
  display: grid;
  gap: 12px;
  justify-items: center;
  overflow-x: auto;
  width: 100%;
}

.screen-actions {
  align-items: center;
  background: rgba(247, 246, 244, 0.78);
  border: 1px solid rgba(223, 221, 215, 0.72);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px;
  width: var(--sheet-width);
}

.primary-button,
.quiet-button,
.hub-tab {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  white-space: nowrap;
}

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

.quiet-button {
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--ui-line);
  color: var(--ink);
}

.quiet-button.small {
  font-size: 0.78rem;
  min-height: 30px;
  padding: 5px 8px;
}

.quiet-button:disabled,
.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.hub-tabs {
  background: rgba(247, 246, 244, 0.75);
  border: 1px solid rgba(223, 221, 215, 0.72);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  padding: 8px;
  width: var(--sheet-width);
}

.hub-tab {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(223, 221, 215, 0.78);
  color: var(--muted);
}

.hub-tab.is-active {
  background: var(--black);
  border-color: var(--black);
  box-shadow: 0 14px 28px rgba(5, 5, 4, 0.14);
  color: white;
}

.session-picker {
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 8px;
  min-height: 38px;
  padding: 5px 8px;
  text-transform: uppercase;
}

.session-picker select,
.practice-tools select {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 30px;
  padding: 4px 8px;
}

.planner-sheet {
  background: var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  max-width: none;
  min-height: 1180px;
  padding: 28px;
  width: var(--sheet-width);
}

.sheet-header {
  display: grid;
  gap: 10px;
}

.sheet-header h1 {
  font-size: 2.4rem;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
}

.header-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr 2fr;
}

.header-field {
  align-items: center;
  border: 2px solid var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 34px;
}

.header-field span,
.practice-title span {
  background: var(--ink);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  height: 100%;
  letter-spacing: 0;
  padding: 8px 10px;
  text-transform: uppercase;
}

.header-field input,
.practice-title input,
.notes-box textarea {
  border: 0;
  color: var(--ink);
  outline: 0;
  width: 100%;
}

.header-field input {
  font-size: 1rem;
  min-height: 30px;
  padding: 4px 8px;
}

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

.practice-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1.35fr 0.9fr;
  min-height: 285px;
}

.practice-row:nth-child(even) {
  grid-template-columns: 0.9fr 1.35fr;
}

.practice-row:nth-child(even) .drawing-box {
  order: 2;
}

.practice-row:nth-child(even) .notes-box {
  order: 1;
}

.drawing-box,
.notes-box {
  border: 2px solid var(--line);
  min-width: 0;
}

.drawing-box {
  background-color: white;
  min-height: 285px;
  position: relative;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.pitch-svg {
  display: block;
  height: 100%;
  inset: 0;
  position: absolute;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
  width: 100%;
}

.notes-box {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.practice-title {
  border-bottom: 2px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
}

.practice-name-field,
.practice-time-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.practice-time-field {
  border-left: 2px solid var(--line);
}

.practice-title input {
  font-size: 1rem;
  font-weight: 700;
  min-height: 34px;
  padding: 5px 8px;
}

.remove-row {
  background: white;
  border: 0;
  border-left: 2px solid var(--line);
  color: #9b2f21;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 8px;
}

.practice-tools {
  align-items: center;
  background: #f7f6f4;
  border-bottom: 1px solid var(--ui-line);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 6px;
}

.practice-tools label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.62rem;
  font-weight: 700;
  gap: 6px;
  text-transform: uppercase;
}

.tool-button {
  align-items: center;
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  font-size: 0.66rem;
  font-weight: 850;
  justify-content: center;
  min-height: 24px;
  padding: 3px 7px;
}

.practice-tools select {
  font-size: 0.74rem;
  max-width: 150px;
  min-height: 24px;
  padding: 2px 6px;
}

.notes-box textarea {
  font-size: 0.82rem;
  line-height: 1.18;
  min-height: 238px;
  padding: 8px 9px;
  resize: vertical;
}

.hub-panel {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  width: var(--sheet-width);
}

.builder-shell {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 320px;
  width: min(100%, var(--sheet-width));
}

.builder-main,
.builder-side {
  min-width: 0;
}

.builder-panel,
.builder-side-panel {
  width: 100%;
}

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

.builder-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.builder-field {
  color: var(--muted);
  display: grid;
  font-size: 0.72rem;
  font-weight: 900;
  gap: 5px;
  text-transform: uppercase;
}

.builder-field input {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  padding: 8px 10px;
  text-transform: none;
}

.builder-summary {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px;
}

.builder-summary span {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 6px 9px;
}

.builder-blocks {
  display: grid;
  gap: 12px;
}

.builder-block {
  background: #fbfbfa;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.builder-block-head {
  align-items: center;
  border-bottom: 1px solid var(--ui-line);
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) 110px;
  padding: 10px;
}

.builder-block-head span {
  align-items: center;
  background: var(--black);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 950;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.builder-block input,
.builder-block textarea {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  color: var(--ink);
  width: 100%;
}

.builder-block input {
  font-weight: 900;
  min-height: 38px;
  padding: 8px 10px;
}

.builder-block textarea {
  font-size: 0.9rem;
  line-height: 1.28;
  min-height: 132px;
  padding: 10px;
  resize: vertical;
}

.builder-block-actions {
  align-items: center;
  border-top: 1px solid var(--ui-line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
}

.builder-block-actions label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.72rem;
  font-weight: 900;
  gap: 6px;
  text-transform: uppercase;
}

.builder-block-actions select {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  min-height: 28px;
  padding: 3px 6px;
}

.text-action {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 900;
  padding: 5px 7px;
}

.builder-side-panel {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 104px;
}

.builder-side-panel h2 {
  font-size: 1rem;
  margin-bottom: 0;
}

.builder-side-panel p {
  color: var(--muted);
  margin: 0;
}

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

.builder-drill-item {
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.builder-drill-item strong,
.builder-drill-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-drill-item span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

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

.panel-head h1 {
  font-size: 2rem;
  margin: 0 0 4px;
}

.panel-head p {
  color: var(--muted);
  margin: 0;
}

.calendar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.calendar-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0 4px 4px;
  text-transform: uppercase;
}

.calendar-day {
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  min-height: 112px;
  padding: 7px;
}

.calendar-day.is-muted {
  background: #f6f4ef;
  color: var(--muted);
}

.calendar-day > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.calendar-sessions {
  display: grid;
  gap: 4px;
}

.calendar-sessions button {
  background: var(--black);
  border: 0;
  border-radius: 4px;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 5px;
  text-align: left;
}

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

.drill-card,
.empty-state {
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 12px;
}

.drill-card h2 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.drill-card p {
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 8px;
}

.drill-card pre {
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.25;
  margin: 0 0 10px;
  max-height: 150px;
  overflow: hidden;
  white-space: pre-wrap;
}

.drill-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  color: var(--muted);
  font-weight: 700;
  grid-column: 1 / -1;
}

.phone-view {
  background: #181a16;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(18, 20, 17, 0.18);
  margin: 0 auto;
  max-width: 460px;
  padding: 14px;
  width: min(100%, 460px);
}

.phone-session-head {
  background: var(--black);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px 20px 0 0;
  color: white;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px;
}

.phone-session-head span {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 12px;
  padding: 6px 9px;
}

.phone-session-head h1 {
  font-size: 1.45rem;
  line-height: 1.08;
  margin: 0 0 6px;
}

.phone-session-head p {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 750;
  margin: 0;
}

.phone-practice-list {
  background: white;
  border-radius: 0 0 20px 20px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.phone-practice-card {
  border-bottom: 1px solid var(--ui-line);
  display: grid;
  gap: 10px;
  padding: 16px;
}

.phone-practice-card:last-child {
  border-bottom: 0;
}

.phone-practice-title {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.phone-practice-title span {
  align-items: center;
  background: var(--black);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.phone-practice-title strong {
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-practice-title em {
  color: var(--accent);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 900;
}

.phone-practice-card p {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.35;
  margin: 0;
}

.planner-toast {
  background: var(--ink);
  border-radius: 999px;
  bottom: 18px;
  color: white;
  font-weight: 700;
  left: 50%;
  opacity: 0;
  padding: 9px 13px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.planner-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 720px) {
  .planner-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .topbar-actions .primary-button {
    grid-column: 1 / -1;
  }

  .planner-main {
    padding: 10px;
  }

  .planner-sheet {
    min-height: 0;
    padding: 14px;
  }

  .sheet-header h1 {
    font-size: 1.8rem;
  }

  .screen-actions {
    justify-content: flex-start;
  }

  .hub-tabs,
  .screen-actions,
  .hub-panel {
    width: 100%;
  }

  .builder-shell {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .builder-meta,
  .builder-block-head {
    grid-template-columns: 1fr;
  }

  .builder-side-panel {
    position: static;
  }

  .hub-tabs,
  .screen-actions {
    overflow-x: auto;
  }

  .session-picker {
    width: 100%;
  }

  .session-picker select {
    min-width: 0;
    width: 100%;
  }

  .calendar-grid {
    min-width: 760px;
  }

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

@page {
  margin: 8mm;
  size: A4 portrait;
}

@media print {
  body {
    background: white;
  }

  .screen-only,
  .planner-toast {
    display: none !important;
  }

  .planner-main {
    padding: 0;
  }

  .planner-sheet {
    box-shadow: none;
    max-width: none;
    min-height: 0;
    padding: 0;
    width: 100%;
  }

  .sheet-header h1 {
    font-size: 1.75rem;
  }

  .header-field {
    min-height: 26px;
  }

  .header-field span,
  .practice-title span {
    font-size: 0.62rem;
    padding: 5px 7px;
  }

  .header-field input {
    font-size: 0.72rem;
    min-height: 24px;
    padding: 3px 6px;
  }

  .practice-list {
    display: block;
  }

  .practice-row {
    gap: 7px;
    grid-template-columns: 1.42fr 0.86fr;
    margin-bottom: 7px;
    min-height: 300px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .practice-row:nth-child(even) {
    grid-template-columns: 0.86fr 1.42fr;
  }

  .practice-row:nth-child(3n) {
    break-after: page;
    page-break-after: always;
  }

  .practice-title {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .practice-title .remove-row {
    display: none !important;
  }

  .practice-name-field {
    min-width: 0;
  }

  .practice-title input {
    font-size: 0.66rem;
    min-height: 23px;
    overflow: hidden;
    padding: 2px 5px;
    text-overflow: ellipsis;
  }

  .drawing-box {
    min-height: 300px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .pitch-svg {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .notes-box textarea {
    font-size: 0.54rem;
    line-height: 1.02;
    min-height: 276px;
    overflow: hidden;
    padding: 4px 5px;
    resize: none;
  }
}
