/* Ringtill. Sage for the brand, pine for actions and for what the front desk did for you. One color family, no second accent.
   Warm, sharp, trustworthy: white space, one typeface, quiet lines, nothing that moves without a reason. */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Sage, built from #8EB19D. 400 carries fills with ink on top; 700 is the lightest shade that reads on white. */
  --sage-50: #F4F8F6; --sage-100: #E7EEEA; --sage-200: #D2E0D8; --sage-300: #B7CDC0; --sage: #8EB19D; --sage-500: #6C9D81;
  --pine: #416851; --pine-800: #2E4C3B; --pine-900: #1C3025;
  --mark: var(--sage-200);
  --white: #FFFFFF; --ground: #F6F8F7; --line: #E1E7E3; --line-strong: #CBD5CF; --muted: #56655D; --ink: #13201A;
  --ok: #1F6B47; --ok-soft: #E2F1E8; --warn: #8A4E12; --warn-soft: #FBEEDC; --bad: #9A2F25; --bad-soft: #FBE5E2;

  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 12px; --radius-sm: 9px; --tabbar: 0px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  /* Names the page-specific stylesheets use. */
  --bg: var(--ground); --card: var(--white); --field: var(--white);
  --accent: var(--pine); --accent-ink: var(--white); --accent-soft: var(--sage-100);
  --display: var(--font); --body: var(--font);
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--pine); text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; border-radius: 4px; }
code { font: 14px/1.4 var(--mono); }

/* Shell */
header.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(24px, env(safe-area-inset-right)) 12px max(24px, env(safe-area-inset-left)); background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--ink); }
.wm { display: inline-flex; align-items: baseline; font-weight: 700; letter-spacing: -0.035em; line-height: 1; color: var(--ink); white-space: nowrap; }
.wm .till { color: var(--pine); }
.wm svg { flex: none; width: 0.34em; height: 0.17em; margin-left: 0.05em; fill: var(--sage); }
.brand .wm { font-size: 23px; }
.brand .name { display: block; font-weight: 600; font-size: 16px; line-height: 1.2; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .by { display: block; line-height: 1.2; }
.brand .by .wm { font-size: 13px; }
nav.main { display: flex; align-items: center; gap: 2px; }
nav.main a { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
nav.main a[aria-current="page"] { color: var(--ink); background: var(--sage-100); }
form.inline { display: inline; margin-left: 6px; }
button.link { background: none; border: none; padding: 8px 10px; color: var(--muted); cursor: pointer; font: inherit; font-size: 15px; min-height: 0; }
nav.tabs { display: none; }
@media (max-width: 720px) {
  :root { --tabbar: calc(60px + env(safe-area-inset-bottom)); }
  header.top { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  nav.main a { display: none; }
  nav.tabs { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: var(--white); border-top: 1px solid var(--line); }
  nav.tabs a { display: grid; justify-items: center; gap: 2px; padding: 5px 0; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
  nav.tabs a svg { width: 22px; height: 22px; }
  nav.tabs a[aria-current="page"] { color: var(--pine); }
}
main { max-width: 1040px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-right)) calc(64px + var(--tabbar)) max(16px, env(safe-area-inset-left)); }
footer { max-width: 1040px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) calc(40px + var(--tabbar)) max(16px, env(safe-area-inset-left)); color: var(--muted); font-size: 14px; }
footer a { color: var(--muted); margin-right: 16px; }

/* Type */
h1 { font-weight: 600; font-size: 30px; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 6px; text-wrap: balance; }
h2 { font-weight: 600; font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; margin: 36px 0 12px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.mono { font-size: 13px; color: var(--muted); }
.err { color: var(--bad); }

/* Surfaces */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 720px) { .row { grid-template-columns: 1fr; } }
.narrow { max-width: 460px; margin: 48px auto; }
.login { max-width: 420px; margin: 56px auto; }
.notice { padding: 12px 16px; background: var(--sage-100); border-radius: 10px; margin-bottom: 20px; }
.notice.bell { background: var(--sage-100); box-shadow: inset 3px 0 0 var(--pine); }
.errors { padding: 12px 16px; background: var(--bad-soft); border: 1px solid #F1CBC5; border-radius: 10px; margin-bottom: 20px; }
.errors ul { margin: 4px 0 0 18px; padding: 0; }
.empty { padding: 18px 20px; background: var(--white); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Badges: neutral by default; solid pine only for what the front desk did for you. */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--ground); color: var(--muted); white-space: nowrap; text-decoration: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--sage-100); color: var(--pine-800); }
.badge.done, .badge.bell { background: var(--pine); color: var(--white); }

/* Forms */
form label { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin: 16px 0 6px; }
input[type=text], input[type=tel], input[type=url], input[type=email], input[type=number], input[type=time], input[type=password], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: 16px; color: var(--ink); background: var(--field); }
input::placeholder, textarea::placeholder { color: #8A968F; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px var(--sage-200); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
label.choice { color: var(--ink); font-size: 15px; font-weight: 400; margin: 10px 0; } label.choice input { margin-right: 8px; }
input[type=checkbox], input[type=radio] { accent-color: var(--pine); width: 18px; height: 18px; vertical-align: -3px; }

/* Buttons: a press answers back before the page does. */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--pine); color: var(--white); font: 600 15px/1.2 var(--font); cursor: pointer; text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 150ms ease; }
button:active, .btn:active { transform: scale(0.97); }
.btn.secondary, button.secondary { background: var(--white); color: var(--ink); border-color: var(--line-strong); }
@media (hover: hover) and (pointer: fine) {
  button:hover, .btn:hover { background: var(--pine-800); }
  .btn.secondary:hover, button.secondary:hover { background: var(--sage-50); }
  button.link:hover { color: var(--ink); background: none; }
  nav.main a:hover { color: var(--ink); background: var(--ground); }
  a.item:hover { background: var(--sage-50); }
}

/* Today */
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0 22px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; background: var(--sage-100); color: var(--pine-800); }
.pill.off { background: var(--bad-soft); color: var(--bad); } .pill.quiet { background: var(--white); color: var(--muted); border: 1px solid var(--line); }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px var(--sage-200); }
.pill.off .live { background: currentColor; box-shadow: none; }
.live.news { animation: news 1.6s var(--ease-out) 2; }
@keyframes news { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sage) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.story { font-weight: 600; font-size: clamp(21px, 2.8vw, 28px); line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 24px; max-width: 40ch; text-wrap: balance; }
.story em, mark.done { font-style: normal; background: var(--mark); color: var(--ink); border-radius: 4px; padding: 0 2px; margin: 0 -1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.stats > div { padding: 16px 20px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats .n { font-weight: 600; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats .n small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stats .l { color: var(--muted); font-size: 14px; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } .stats > div:nth-child(odd) { border-left: 0; } .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
.stat .n { font-weight: 600; font-size: 28px; font-variant-numeric: tabular-nums; } .stat .l { color: var(--muted); font-size: 14px; }
.list { display: grid; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: background-color 150ms ease; }
.item:first-child { border-top: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--sage-100); color: var(--pine-800); }
.avatar.unknown, .avatar.bell { background: var(--ground); color: var(--muted); border: 1px solid var(--line); }
.avatar svg { width: 18px; height: 18px; }
.item .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .what { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .side { display: grid; justify-items: end; gap: 6px; }
.item time, time.at { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) {
  .item { grid-template-columns: 40px minmax(0, 1fr); padding: 14px 16px; }
  .item .side { grid-column: 2; grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
}

/* A call, printed as dialogue: the caller in grey, the front desk in ink. */
.dialogue { display: grid; gap: 12px; margin: 0; padding: 22px 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.dialogue p { margin: 0; padding-left: 22px; text-indent: -22px; font-size: 17px; line-height: 1.5; max-width: 68ch; }
.dialogue p::before { content: "\2014\00a0"; }
.dialogue .caller { color: var(--muted); }
.dialogue .desk { color: var(--ink); font-weight: 500; }
.dialogue .legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); text-indent: 0; padding: 0; margin-bottom: 4px; }
.dialogue .legend::before { content: none; }
.dialogue .legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dialogue .legend .k-caller::before { background: var(--line-strong); } .dialogue .legend .k-desk::before { background: var(--sage); }
.lead { font-size: 19px; line-height: 1.55; max-width: 64ch; margin: 0 0 8px; }

/* Setup */
.steps { list-style: none; padding: 0; margin: 0; } .steps li { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.steps li:first-child { padding-top: 4px; } .steps li:last-child { border-bottom: none; padding-bottom: 4px; }
.dot { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.dot.done { background: var(--pine); border-color: var(--pine); color: var(--white); }
.import-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; } @media (max-width: 640px) { .import-form { grid-template-columns: 1fr; } }
.found { margin: 8px 0 0 18px; padding: 0; } .found li { margin: 4px 0; } .found.warnings { color: var(--warn); }
details.card > summary, .fwd > summary { cursor: pointer; }
.fwd-grid { display: grid; gap: 10px; margin: 12px 0; } .fwd-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--white); }
.fwd-grid span { display: block; font-size: 15px; color: var(--muted); margin-top: 4px; }
.fwd-grid code { color: var(--ink); background: var(--sage-100); padding: 2px 7px; border-radius: 6px; overflow-wrap: anywhere; }
.mapstrip { position: relative; height: 140px; margin-top: 12px; border-radius: 10px; overflow: hidden; background: var(--sage-100); border: 1px solid var(--line); }
.mapstrip-label { position: absolute; left: 10px; bottom: 8px; font-size: 13px; color: var(--muted); } .mapstrip.ready .mapstrip-label { display: none; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--sage-200); border-top-color: var(--pine); animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.reveal li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--ground); color: var(--muted); }
.reveal li.done { color: var(--ink); } .reveal li.now { color: var(--ink); font-weight: 600; }
.tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; border: 2px solid var(--line-strong); }
.reveal li.done .tick { background: var(--pine); border-color: var(--pine); color: var(--white); }
.reveal li.now .tick { border-color: var(--pine); border-top-color: transparent; animation: spin 0.8s linear infinite; }

/* The two moments worth celebrating: going live and the first booking. Each plays once. */
.moment { display: grid; gap: 6px; padding: 22px 24px; border-radius: var(--radius); background: var(--sage-100); margin-bottom: 24px; }
.moment strong { font-size: 21px; line-height: 1.3; letter-spacing: -0.015em; }
.moment.play { animation: moment-in 520ms var(--ease-out) both; }
.moment.play mark.done { background-size: 0% 100%; animation: marker 700ms var(--ease-out) 380ms forwards; background-image: linear-gradient(var(--mark), var(--mark)); background-repeat: no-repeat; background-color: transparent; }
@keyframes moment-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes marker { to { background-size: 100% 100%; } }

/* Toast: rises from where you pressed Save, leaves the same way. */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 24px); z-index: 40; transform: translateX(-50%); padding: 12px 18px; border-radius: 12px;
  background: var(--ink); color: var(--white); font-size: 15px; font-weight: 500; box-shadow: 0 16px 32px -20px rgba(19, 32, 26, 0.6);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translate(-50%, 10px); } }
.toast.leaving { opacity: 0; transform: translate(-50%, 10px); transition-duration: 160ms; }

@media (prefers-reduced-motion: reduce) {
  .spinner, .reveal li.now .tick, .live.news { animation: none; }
  .moment.play { animation: fade 200ms ease both; }
  .moment.play mark.done { animation: none; background-size: 100% 100%; }
  button:active, .btn:active { transform: none; }
  .toast { transition: opacity 150ms ease; }
}
@keyframes fade { from { opacity: 0; } }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Minutes meter: pine while there's room, ink from four fifths and once used. */
.meter { height: 8px; border-radius: 999px; background: var(--sage-100); overflow: hidden; margin: 10px 0 8px; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--pine); min-width: 4px; }
.meter.warn > i, .meter.full > i { background: var(--ink); }
.meter-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-text strong { color: var(--ink); }
.pill.warn { background: var(--ink); color: var(--white); }
.pill.warn .live { background: var(--sage); box-shadow: 0 0 0 3px rgba(142, 177, 157, 0.35); }

/* Billing */
.plan-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.plan-name strong { font-size: 20px; letter-spacing: -0.015em; }
.price { font-size: 32px; font-weight: 600; letter-spacing: -0.025em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.includes { list-style: none; margin: 14px 0 18px; padding: 0; display: grid; gap: 8px; }
.includes li { display: flex; gap: 10px; align-items: flex-start; }
.includes li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--sage-100) no-repeat center / 11px 11px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5 4.8 9 10 3' fill='none' stroke='%23416851' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.fine { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.actions form { margin: 0; }
