:root {
  --orange: #FF6B00;
  --orange-dark: #D95A00;
  --orange-soft: #FFF1E6;
  --ink: #1E1E1E;
  --muted: #6B6B6B;
  --line: #EDEDED;
  --white: #FFFFFF;
  --danger: #C62828;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  font-size: 16px;
  line-height: 1.45;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 22px;
  color: var(--orange);
  letter-spacing: -0.3px;
}

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

.nav button {
  background: none;
  border: 0;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.nav button.active { background: var(--orange-soft); color: var(--orange-dark); }
.nav .badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--white);
  font-size: 12px;
  text-align: center;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 20px; }
/* Job picker: search, then one dropdown per category */
.tag-picker { display: grid; gap: 10px; }
.tp-search { font-size: 16px; }
.tp-picked { margin: 0; font-size: 14px; }
.tp-group {
  border: 1px solid var(--line); border-radius: 12px; background: var(--white); overflow: hidden;
}
.tp-group summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 14px 14px; font-weight: 700; font-size: 15px;
}
.tp-group summary::-webkit-details-marker { display: none; }
.tp-group summary::after {
  content: ''; width: 8px; height: 8px; flex-shrink: 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); margin: 0 4px 2px 6px; transition: transform 0.15s;
}
.tp-group[open] summary::after { transform: rotate(-135deg); margin: 2px 4px 0 6px; }
.tp-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.tp-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
@media (max-width: 560px) { .tp-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tp-chip {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 14px; line-height: 1.25; font-weight: 500; cursor: pointer; background: var(--white);
  min-width: 0;
}
.tp-chip input { width: auto; margin: 0; accent-color: var(--orange); }
.tp-chip:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); font-weight: 600; }
.tp-chip.tp-hidden { display: none; }

/* Settings menu */
.menu { display: grid; gap: 10px; }
.menu-row {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  font: inherit; font-weight: 700; font-size: 16px; color: var(--ink); text-align: left; cursor: pointer;
}
.menu-row small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 2px; }
.menu-row::after { content: '›'; font-size: 24px; color: var(--muted); margin-left: 12px; }
.menu-row:hover { border-color: var(--orange); }
.back { display: inline-block; margin: 4px 0 0; font-size: 15px; }

/* Landing page: brand on the left, log in or sign up on the right */
.landing {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 80px);
}
.hero-brand { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.hero-brand img { width: 96px; height: 96px; }
.hero-brand span { font-size: 96px; font-weight: 800; color: var(--orange); letter-spacing: -2px; line-height: 1; }
.hero h1 { font-size: 46px; line-height: 1.1; letter-spacing: -1px; margin: 0 0 16px; }
.hero p { font-size: 19px; color: var(--muted); margin: 0; max-width: 460px; }
.landing .auth { margin: 0; max-width: 440px; width: 100%; justify-self: end; padding: 32px; box-shadow: 0 8px 32px rgba(0,0,0,0.06); }
.auth-title { font-size: 24px; margin: 0 0 12px; }
@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; gap: 28px; padding: 28px 16px 48px; min-height: 0; }
  .hero-brand img { width: 64px; height: 64px; }
  .hero-brand span { font-size: 64px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 17px; }
  .landing .auth { justify-self: stretch; max-width: none; }
}

@media (min-width: 900px) {
  .wrap { max-width: 1120px; padding: 32px 40px; }
  .card { padding: 22px 24px; }
  .topbar { padding: 14px 40px; }
  .auth { max-width: 480px; }
}

h1 { font-size: 26px; margin: 8px 0 16px; letter-spacing: -0.4px; }
h2 { font-size: 19px; margin: 20px 0 10px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--white);
}

.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-title { font-weight: 700; font-size: 17px; }
.muted { color: var(--muted); font-size: 14px; }

.rate {
  font-size: 22px;
  font-weight: 800;
  color: var(--orange);
  white-space: nowrap;
}
.rate small { font-size: 13px; font-weight: 600; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-dark);
}
.chip.neutral { background: #F2F2F2; color: var(--muted); }
.chip.done { background: #E8F5E9; color: #2E7D32; }

.btn {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--orange-dark); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: var(--white); color: var(--orange-dark); border: 1px solid var(--orange); }
.btn.small { padding: 7px 14px; font-size: 14px; }

form { display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

label { display: grid; gap: 8px; font-weight: 600; font-size: 14px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 13px; line-height: 1.4; display: block; margin-top: 2px; }
fieldset.choice legend { margin-bottom: 10px; }
.repeat-box { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #FAFAFA; }
label.check { font-weight: 600; font-size: 15px; }

input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #DADADA;
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); border-color: var(--orange); }
textarea { min-height: 80px; resize: vertical; }

.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.check input { width: auto; }

.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.msg.error { background: #FDECEA; color: var(--danger); }
.msg.ok { background: #E8F5E9; color: #2E7D32; }

.auth {
  max-width: 420px;
  margin: 40px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.auth .tagline { color: var(--muted); margin-top: -8px; }
.link { background: none; border: 0; color: var(--orange-dark); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 22px; color: var(--orange); }
.stat span { font-size: 12px; color: var(--muted); }

.notif { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif.unread { font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-top: 7px; flex-shrink: 0; }

.auth.wide { max-width: 560px; }
fieldset.choice { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.choice legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
@media (max-width: 560px) { .checks { grid-template-columns: 1fr; } }
.checks .check { font-weight: 500; }
.choice-card {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500 !important;
}
.choice-card:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.choice-card input { width: auto; margin-top: 4px; }

/* Toolbar, segmented controls, tabs */
.toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--orange); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.seg button {
  background: var(--white);
  border: 0;
  padding: 7px 14px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--orange-dark);
  cursor: pointer;
}
.seg button.on { background: var(--orange); color: var(--white); }
.seg.tabs { flex-wrap: wrap; border-radius: 12px; }

/* Calendar */
.calhead { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 10px; }
.grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.grid7.dow div { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.cell {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  padding: 4px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cell.blank { border: 0; background: transparent; cursor: default; }
.cell.has { border-color: #F5C9A6; }
.cell.sel { border: 2px solid var(--orange); }
.dnum { font-size: 12px; font-weight: 700; color: var(--muted); }
.pill {
  font-size: 11px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  border-radius: 6px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.more { font-size: 11px; color: var(--muted); }
@media (max-width: 560px) {
  .cell { min-height: 52px; padding: 3px; }
  .pill { font-size: 10px; }
  .cell .pill:nth-of-type(2) { display: none; }
}

/* Nav icons: hidden on desktop, shown in the bottom bar on phones */
.nav-ico { display: none; }
.nav:empty { display: none; }

/* Phones: tabs move to a bottom bar with icons */
@media (max-width: 760px) {
  body { padding-bottom: 92px; }
  .topbar { padding: 12px 16px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; justify-content: space-around; gap: 4px; flex-wrap: nowrap;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--white);
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.07);
  }
  .nav button {
    position: relative; flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 2px; border-radius: 14px;
    font-size: 11px; font-weight: 700; color: var(--muted);
  }
  .nav button.active { background: var(--orange-soft); color: var(--orange-dark); }
  .nav-ico { display: flex; }
  .nav-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav .badge { position: absolute; top: 4px; left: 50%; margin: 0 0 0 8px; font-size: 10px; min-width: 16px; }
}

/* Covered-shift chip and open-shift pay bar */
.chip.accent { background: var(--orange-soft); color: var(--orange-dark); }
.pbar { margin: 12px 0 4px; }
.pbar-track {
  position: relative; height: 10px; border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg, #111111, var(--orange));
}
.pbar.desc .pbar-track { background: linear-gradient(90deg, var(--orange), #111111); }
.pbar-rest {
  position: absolute; top: 0; bottom: 0; right: 0;
  width: calc(100% - var(--p)); background: #e4e4e4;
}
.pbar-dot {
  position: absolute; top: 50%; left: var(--p);
  width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: #fff; border: 3px solid #111111; box-sizing: border-box;
}
.pbar-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Sheets (bottom dialogs), ratings, footer */
.sheet-wrap {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; padding: 12px;
}
.sheet {
  background: #fff; border-radius: 18px; padding: 18px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.sheet-title { margin: 4px 0 8px; font-size: 20px; }
.stars { display: flex; gap: 4px; margin: 8px 0 12px; }
.star {
  font-size: 34px; line-height: 1; background: none; border: 0; color: #cfcfcf;
  cursor: pointer; min-width: 44px; min-height: 44px; padding: 0;
}
.star.on { color: var(--orange); }
.site-foot { padding: 24px 16px 40px; color: var(--muted); font-size: 13px; text-align: center; }
.site-foot a { color: var(--muted); }

/* Legal pages */
.legal { max-width: 720px; padding-bottom: 40px; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { margin-top: 22px; font-size: 18px; }
.legal p, .legal li { line-height: 1.55; }
