/* StudySpot Network — reading-room seat board.
   Palette from the reading room: lamp-enamel green, ink, paper, brass lamplight.
   Type: Newsreader (display, self-hosted) + Inter (UI/data, tabular numerals). */
@font-face {
  font-family: "Newsreader";
  src: url("./fonts/newsreader-var.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./fonts/inter-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f7f4;
  --ink: #17251f;
  --muted: #54655b;
  --lamp: #0c5b40;
  --lamp-deep: #083f2e;
  --lamp-dark: #0a4c35;
  --lamp-tint: #edf4ee;
  --brass: #b57a12;
  --card: #ffffff;
  --line: #dce3dc;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  line-height: 1.55;
}
h1, h2, h3 { font-family: var(--serif); }
a { color: var(--lamp); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* Masthead: the reading-room sign. Full-bleed lamp-green band; the demo note
   sits inside it as a paper notice strip with a brass edge. */
.site-header {
  background: var(--lamp-deep);
  color: #eef4ee;
  padding: 46px max(20px, calc((100% - 1080px) / 2)) 34px;
}
.site-header h1 {
  font-size: 2.9rem;
  font-weight: 600;
  line-height: 1.08;
  color: #ffffff;
  margin: 0 0 10px;
}
.tagline {
  position: relative;
  font-size: 1.08rem;
  color: #d9e7da;
  max-width: 62ch;
  margin: 0;
  padding-top: 16px;
}
.tagline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 3px;
  background: var(--brass);
}
.site-header .demo-note {
  background: var(--paper);
  color: var(--muted);
  border-left: 3px solid var(--brass);
  padding: 10px 14px;
  margin: 24px 0 0;
  max-width: 78ch;
}
.demo-note { color: var(--muted); font-size: 0.9rem; }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 38px 20px 8px;
}
main section { margin-bottom: 46px; }
main h2 {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 18px;
}

/* Seat cards: the free count is the hero datum; name and hours frame it,
   features drop to a quiet inline row. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}
.card h3 { margin: 0 0 10px; font-size: 1.3rem; font-weight: 600; line-height: 1.25; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.free {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--lamp);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
.card ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 0 0 18px;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.card button { margin-top: auto; align-self: flex-start; }
.card:has(button:disabled) { background: #eff2ee; }
.card:has(button:disabled) .free { color: var(--muted); }

button {
  background: var(--lamp);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 150ms ease;
}
button:disabled { background: #c9d2cb; color: #5a6b60; cursor: not-allowed; }
/* Hover darkening is scoped to this page's own buttons; the runtime's buttons
   inside #agent-app keep the behaviour they had before (no site hover rule). */
.card button:not(:disabled):hover,
#confirm-dialog button:not([value="cancel"]):hover { background: var(--lamp-dark); }
button[value="cancel"] { background: transparent; color: var(--ink); border: 1px solid #b9c4ba; }
button[value="cancel"]:hover { background: transparent; border-color: var(--ink); }

/* Ledger line under the board. */
.state-line {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.state-line span { color: var(--ink); font-weight: 600; }
#reservation-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#reservation-actions button { background: transparent; color: var(--ink); border: 1px solid #b9c4ba; }
#reservation-actions button:hover { background: transparent; border-color: var(--ink); }

/* The reservation receipt: a hold slip with a perforated brass stub edge. */
.feedback {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 3px dashed var(--brass);
  border-radius: 10px;
  padding: 14px 18px 14px 20px;
  margin-top: 14px;
  font-size: 0.98rem;
}

dialog {
  border: 1px solid var(--line);
  border-top: 6px solid var(--lamp);
  border-radius: 12px;
  max-width: 420px;
  padding: 22px 24px;
  background: #ffffff;
  color: var(--ink);
}
dialog h3 { margin: 0 0 10px; font-size: 1.35rem; font-weight: 600; }
dialog form { display: flex; gap: 10px; margin-top: 16px; }

/* Partner panel: the canteen lives elsewhere; the panel says so. */
.partner-panel {
  background: var(--lamp-tint);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px;
}
.partner-panel p { max-width: 74ch; margin: 0 0 12px; }
.partner-panel p:last-child { margin-bottom: 0; }
.partner-panel a { font-weight: 600; }

.colophon {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 42px;
  color: var(--muted);
  font-size: 0.9rem;
}
.colophon p { border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }

/* Assistant layout (templates/assistant.css from the agentify-website skill),
   with the --ns-* colors set to this site's palette: lamp green #0c5b40 primary
   (white on it is ~6.3:1), the page's card/border/muted tones below. */
.assistant-note { color: var(--muted); font-size: 0.92rem; }
#assistant-status { color: var(--muted); }

#agent-app {
  --ns-font: "Inter", system-ui, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #17251f;
  --ns-primary: #0c5b40;
  --ns-accent: #0c5b40;
  --ns-border: #dce3dc;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #edf4ee;
  --ns-muted: #54655b;
}

.assistant-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  margin-top: 16px;
}

/* Set the height once the runtime has mounted the chat, so a failed load leaves no
   empty box. */
#agent-app.ns-composed-app [data-ns-slot="chat"] { height: 720px; }
/* The runtime gives the chat no background of its own. Keep --ns-msgbg different from
   --ns-bg, or bot replies lose their bubble. */
#agent-app .ns-chat { background: var(--ns-bg); }

/* Site-wide form rules often stretch the runtime's own controls. Undo them here. */
#agent-app input[type="checkbox"],
#agent-app input[type="radio"] { width: auto; }
#agent-app .ns-header { flex-wrap: wrap; }
/* Site label rules add margins and bold text, and the inputs inside the labels inherit
   the weight. */
#agent-app .ns-settings-body label { margin: 4px 0; font-weight: 400; }
/* Chat forms label radio groups with a legend, so site legend fonts would reach them. */
#agent-app .ns-w-label { font-family: inherit; }
/* Site label rules add margins to chat form fields and make their options bold. */
#agent-app .ns-widget label { margin: 0; }
#agent-app .ns-w-radio label,
#agent-app .ns-w-multi label,
#agent-app .ns-w-toggle { font-weight: 400; }
/* The runtime sizes radio and multi-choice options but not the checkbox label. */
#agent-app .ns-w-toggle { font-size: 13px; }
/* The runtime spaces its buttons with gap. A site's button margin pushes Send below the input. */
#agent-app button { margin: 0; }
/* This site's global button rule paints every button teal with white text. The
   runtime's plain buttons (choices, dev toggle, modal close) carry dark text on
   light backgrounds of their own, so undo the paint for them. */
#agent-app .ns-w-choice { color: var(--ns-fg); background: var(--ns-msgbg); }
/* A site's button:hover background also reaches the runtime's plain buttons, behind
   their dark text. Keep the runtime's own backgrounds. */
#agent-app .ns-devtoggle:not(.on):hover,
#agent-app .ns-modal-close:hover { background: transparent; }
#agent-app .ns-w-choice:disabled:hover { background: #fafbfc; }
/* The runtime's message rule hides the partner consent card's own background, and its
   Decline label then has too little contrast. */
#agent-app .ns-consent { background: #fffbeb; }
/* While a consent card waits, the status line above it already says "Contacting", though
   nothing has been sent. Hide it until the visitor answers. */
#agent-app .ns-msgs:has(.ns-consent-actions) > .ns-turn-status { display: none; }
/* Long links in a reply would run out of the bubble on a phone. "anywhere" would also
   let the consent card's buttons shrink and split their labels. */
#agent-app .ns-msg { overflow-wrap: break-word; }
/* On a phone the consent card is too narrow for its three buttons in one row, and
   "Always allow" breaks onto two lines. Keep each label whole and wrap the row. */
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }

/* site.js and the runtime add their confirmation dialogs to <body>, outside #agent-app.
   Site h2 rules reach the heading, and the two buttons touch. A right margin keeps
   wrapped buttons lined up on the left. */
body > dialog h2 { margin: 0 0 12px; font: 600 1.25em "Newsreader", Georgia, serif; }
body > dialog button { margin-right: 8px; }
/* site.js's dialog: the details in two columns, and a plain decline button, so the two
   choices do not look the same. */
.assistant-review { max-width: 640px; width: 85%; max-height: 85vh; overflow: auto; border: 1px solid #888; border-radius: 12px; padding: 24px; font: 16px "Inter", system-ui, sans-serif; }
.assistant-review dl { display: grid; grid-template-columns: fit-content(40%) 1fr; gap: 4px 16px; margin: 12px 0; }
.assistant-review dt { font-weight: 600; }
.assistant-review dd { margin: 0; overflow-wrap: anywhere; }
.assistant-review details { margin: 12px 0; }
.assistant-review pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-review .assistant-decline { background: transparent; color: inherit; border: 1px solid currentColor; }

@media (max-width: 760px) {
  .site-header { padding-top: 34px; padding-bottom: 26px; }
  .site-header h1 { font-size: 2.15rem; }
  main { padding-top: 28px; }
  main h2 { font-size: 1.45rem; }
  .free { font-size: 2.1rem; }
  .assistant-panels { grid-template-columns: 1fr; }
  /* On a phone, each detail goes under its label, so an email is not split. */
  .assistant-review dl { grid-template-columns: 1fr; gap: 0; }
  .assistant-review dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
