:root {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #151b24;
  --surface-strong: #1d2633;
  --line: #303947;
  --text: #f5f7fb;
  --muted: #9aa7b8;
  --red: #ef3f46;
  --red-soft: rgba(239, 63, 70, 0.18);
  --teal: #4fd1c5;
  --green: #65d38a;
  --amber: #f4b740;
  --blue: #6da8ff;
  --radius: 8px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(180deg, rgba(13, 17, 23, 0.18), var(--bg) 78%),
    url("https://images.unsplash.com/photo-1617347454431-f49d7ff5c3b1?auto=format&fit=crop&w=1800&q=80") center/cover;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(13, 17, 23, 0.78);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(18px);
}

.header-account {
  position: relative;
}

.header-profile {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 27, 36, 0.95);
  color: inherit;
  cursor: pointer;
}

.header-profile strong,
.header-profile small {
  display: block;
}

.header-profile strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.header-profile small {
  color: var(--muted);
  font-size: 11px;
}

.header-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: var(--red);
  color: white;
  font-size: 14px;
  font-weight: 800;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-menu strong,
.account-menu span {
  display: block;
}

.account-menu span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-menu button {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 700;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--red);
  color: white;
  font-size: 22px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.top-nav a,
.secondary-action,
.primary-action,
.segmented button {
  min-height: 40px;
  border-radius: var(--radius);
  font-weight: 700;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  color: #cbd3df;
  font-size: 14px;
}

.top-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

main {
  padding: 18px 0 48px;
}

.hero {
  display: flex;
  min-height: 430px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: clamp(22px, 5vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(13, 17, 23, 0.9) 0%, rgba(13, 17, 23, 0.68) 50%, rgba(13, 17, 23, 0.24) 100%),
    url("https://images.unsplash.com/photo-1608066377168-1a34254f1d20?auto=format&fit=crop&w=1600&q=80") center/cover;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 66px);
  line-height: 1.02;
}

h2 {
  margin: 0;
  font-size: 22px;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0 0;
  color: #d6dde8;
  font-size: 17px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0 16px;
}

.primary-action {
  background: var(--red);
  color: white;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.full-width {
  width: 100%;
}

.status-band,
.workspace {
  display: grid;
  gap: 12px;
}

.status-band {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) 360px;
  margin-top: 16px;
}

.status-band article,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(21, 27, 36, 0.92);
  box-shadow: var(--shadow);
}

.status-band article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  padding: 16px;
}

.status-band p,
.status-band strong {
  margin: 0;
}

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

.status-band strong {
  grid-column: 2;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border-radius: 50%;
}

.warning {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(244, 183, 64, 0.16);
}

.ready {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(101, 211, 138, 0.14);
}

.neutral {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(109, 168, 255, 0.14);
}

.notice {
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(79, 209, 197, 0.36);
  border-radius: var(--radius);
  background: rgba(16, 23, 32, 0.95);
  color: #dbe7f3;
  box-shadow: var(--shadow);
}

.notice.error {
  border-color: rgba(239, 63, 70, 0.54);
  background: rgba(70, 24, 30, 0.9);
}

.notice.success {
  border-color: rgba(101, 211, 138, 0.48);
  background: rgba(22, 58, 38, 0.9);
}

.panel {
  padding: 18px;
}

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

.settings-form,
.integration-panel {
  display: grid;
  gap: 15px;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 18px;
}

.login-box {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.verification-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.inline-status {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid rgba(79, 209, 197, 0.26);
  border-radius: var(--radius);
  background: rgba(79, 209, 197, 0.08);
}

.inline-status span,
.user-layout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.user-layout {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: var(--red);
  color: white;
  font-size: 24px;
  font-weight: 800;
}

.user-layout strong {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
}

.settings-form label,
.readonly-label {
  display: grid;
  gap: 7px;
  color: #dce3ec;
  font-size: 13px;
  font-weight: 700;
}

.settings-form input,
.settings-form select,
.readonly-label input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101720;
  color: var(--text);
  padding: 0 12px;
  outline: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.range-value,
.small-note,
.integration-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.small-note code {
  color: var(--text);
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101720;
}

.segmented button {
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--surface-strong);
  color: var(--text);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.day-card {
  min-height: 210px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111821;
}

.day-card.selected {
  border-color: rgba(239, 63, 70, 0.72);
  background: linear-gradient(180deg, var(--red-soft), #111821 62%);
}

.day-card.today {
  border-color: rgba(79, 209, 197, 0.86);
}

.day-card button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.day-name {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-date {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  font-weight: 800;
}

.shift-pill {
  display: inline-flex;
  margin-top: 18px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(79, 209, 197, 0.14);
  color: #a5fff7;
  font-size: 12px;
  font-weight: 800;
}

.day-card p {
  margin: 12px 0 0;
  color: #bac4d1;
  font-size: 13px;
  line-height: 1.45;
}

.checkout-box {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101720;
}

.checkout-box span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.activity-panel {
  margin-top: 16px;
}

.activity-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101720;
}

.activity-list time {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.activity-list span {
  color: var(--muted);
  line-height: 1.55;
}

.activity-list strong {
  display: block;
  color: var(--text);
}

.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: min(560px, calc(100% - 32px));
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 27, 36, 0.98);
  box-shadow: var(--shadow);
}

.cookie-banner strong,
.cookie-banner p {
  margin: 0;
}

.cookie-banner p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

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

.is-authenticated #heroRegisterButton,
.is-authenticated .hero-actions a[href="#account"] {
  display: none !important;
}

.is-authenticated #userPanel {
  display: none !important;
}

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

  .planner-panel,
  .checkout-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .app-header,
  main {
    width: min(100% - 22px, 1180px);
  }

  .app-header {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
  }

  .top-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .header-profile {
    max-width: 190px;
    padding: 6px 8px;
  }

  .header-profile strong {
    max-width: 110px;
  }

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

  .top-nav a {
    min-width: max-content;
    min-height: 36px;
    padding: 0 11px;
  }

  .hero {
    min-height: 450px;
    padding: 24px 18px;
    background:
      linear-gradient(180deg, rgba(13, 17, 23, 0.38) 0%, rgba(13, 17, 23, 0.94) 78%),
      url("https://images.unsplash.com/photo-1608066377168-1a34254f1d20?auto=format&fit=crop&w=1200&q=80") center/cover;
  }

  h1 {
    font-size: 34px;
    line-height: 1.06;
  }

  h2 {
    font-size: 20px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 15px;
    line-height: 1.55;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-action,
  .secondary-action {
    min-height: 44px;
  }

  .status-band,
  .workspace {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

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

  .day-card {
    min-height: 164px;
  }

  .form-row,
  .auth-grid,
  .cookie-banner,
  .activity-list li {
    grid-template-columns: 1fr;
  }

  .login-box {
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 420px) {
  .app-header,
  main {
    width: min(100% - 16px, 1180px);
  }

  .brand-mark,
  .icon-button {
    width: 38px;
    height: 38px;
  }

  .header-account {
    grid-column: 1 / -1;
    width: 100%;
  }

  .header-profile {
    width: 100%;
    max-width: none;
  }

  .header-profile strong {
    max-width: calc(100vw - 96px);
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    font-size: 11px;
  }

  .hero {
    min-height: 420px;
  }

  h1 {
    font-size: 30px;
  }

  .week-grid {
    gap: 8px;
  }

  .day-card {
    min-height: 154px;
    padding: 10px;
  }
}
