:root { --ink: #091333; --red: #D64D3B; --yellow: #FFCC52; --blue: #60B4E0; --deep: #1D658B; --green: #A1BF68; --paper: #F6F4EF; --line: #e3e5ec; --mut: #646b85; --r: 10px; --font: 'Montserrat', system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; font: 450 15px/1.5 var(--font); color: var(--ink); background: #f4f5f8; }
a { color: var(--deep); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
h1, h2 { letter-spacing: -.02em; line-height: 1.15; }
small { font-size: .82em; }
.muted { color: var(--mut); }
.red { color: var(--red); }
code { background: #eef0f5; padding: .1em .35em; border-radius: 4px; font-size: .9em; }
img { max-width: 100%; }

/* layout */
body.admin { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #c9cde0; padding: 1rem .8rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }
.side-logo img { width: 180px; display: block; margin: .2rem .3rem .4rem; }
.side-ask { display: flex; align-items: center; gap: .6rem; background: var(--yellow); color: var(--ink); text-decoration: none; font-weight: 750; padding: .7rem .9rem; border-radius: var(--r); }
.side-ask.is-on { box-shadow: inset 0 0 0 2px #fff; }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: .7rem; color: #c9cde0; text-decoration: none; padding: .55rem .8rem; border-radius: 8px; font-weight: 550; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.is-on { background: rgba(255,255,255,.12); color: #fff; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: .4rem .5rem; font-size: .85rem; }
.side-foot a { color: #fff; }
.side-foot button { background: none; border: 0; color: #c9cde0; font: inherit; cursor: pointer; text-decoration: underline; }
.main { padding: 1.8rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 1200px; width: 100%; }
.main.is-wide { max-width: none; }
@media (max-width: 860px) {
  body.admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side nav ul { display: flex; flex-wrap: wrap; }
  .side nav a span { display: none; }
  .side-foot { margin: 0; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.9rem; font-weight: 800; margin: 0 0 .2rem; }
.page-head p { margin: 0; color: var(--mut); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.flash { background: #e7f4dc; border-left: 4px solid var(--green); padding: .7rem 1rem; border-radius: 6px; font-weight: 600; margin: 0 0 1.2rem; }
.flash.warn { background: #fff4d6; border-color: var(--yellow); }
.box { background: #fff; border-radius: var(--r); padding: 1.2rem 1.4rem; border: 1px solid var(--line); margin-bottom: 1.2rem; }
.box h2 { font-size: 1.1rem; font-weight: 750; margin: 0 0 .9rem; }
.note-box { border-left: 4px solid var(--yellow); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.cols-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1000px) { .cols, .cols-2-1 { grid-template-columns: 1fr; } }

/* buttons */
.b { display: inline-flex; align-items: center; gap: .4rem; font: 700 .88rem/1 var(--font); padding: .7rem 1.1rem; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; color: var(--ink); background: none; white-space: nowrap; }
.b svg { width: 16px; height: 16px; }
.b-ink { background: var(--ink); color: #fff; }
.b-yellow { background: var(--yellow); }
.b-ghost { border-color: #c9ccd8; background: #fff; }
.b-ghost:hover { border-color: var(--ink); }
.b-sm { padding: .45rem .8rem; font-size: .8rem; }
.b-block { width: 100%; justify-content: center; }
.b-danger-text { color: #b3301c; padding-left: 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.2rem; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.2rem; display: grid; }
.stats b { font-size: 2rem; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; }
.stats span { color: var(--mut); font-size: .88rem; }
@media (max-width: 800px) { .stats { grid-template-columns: 1fr 1fr; } }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: .8rem; align-items: center; padding: .6rem 0 .6rem .8rem; border-bottom: 1px solid var(--line); border-left: 4px solid var(--pig); }
.ag-when { font-size: .8rem; color: var(--mut); line-height: 1.3; }
.ag-when b { color: var(--ink); font-size: .95rem; }
.agenda a { color: var(--ink); font-weight: 650; text-decoration: none; }
.cap { font-size: .85rem; color: var(--mut); white-space: nowrap; }
.cap b { color: var(--ink); }
.cap.is-low b { color: #b3301c; } .cap.is-full { color: #fff; background: var(--ink); padding: .1rem .5rem; border-radius: 999px; } .cap.is-full b { color: #fff; }

/* tables */
.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
.t th { text-align: left; font-size: .78rem; color: var(--mut); font-weight: 650; padding: .5rem .6rem; border-bottom: 2px solid var(--line); }
.t td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.t-full { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.t tr.dim td { opacity: .55; }
.t .thumb { width: 56px; } .t .thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }
.sw { display: inline-flex; align-items: center; gap: .35rem; color: var(--mut); }
.sw::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--pig); }
.tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: #eef0f5; color: var(--ink); white-space: nowrap; }
.tag svg { width: 13px; height: 13px; }
.tag-confirmed { background: #e3f1d6; } .tag-waitlist { background: #fff1cc; } .tag-cancelled { background: #fbe1dc; color: #8f2615; }
.tag-claude { background: var(--yellow); }
.toggle { font: 650 .78rem var(--font); border: 1.5px solid #c9ccd8; background: #fff; border-radius: 999px; padding: .25rem .7rem; cursor: pointer; color: var(--mut); }
.toggle.on { background: #e3f1d6; border-color: #b9d99c; color: #2c5310; }
form.inline { display: inline; margin: 0; }
form.inline select { font: inherit; font-size: .85rem; padding: .2rem; border-radius: 6px; border: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input, .filters select { font: inherit; padding: .55rem .8rem; border-radius: 8px; border: 1.5px solid #c9ccd8; background: #fff; }
.filters input[type=search] { min-width: 280px; flex: 1; max-width: 420px; }

/* forms */
.form { display: grid; gap: .9rem; }
.f { display: grid; gap: .3rem; font-weight: 650; font-size: .85rem; }
.f small { font-weight: 500; color: var(--mut); }
.f input, .f select, .f textarea { font: 500 .95rem var(--font); color: var(--ink); padding: .6rem .75rem; border-radius: 8px; border: 1.5px solid #c9ccd8; background: #fff; width: 100%; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px #ffe7a3; }
.f.chk { display: flex; align-items: center; gap: .5rem; font-weight: 600; align-self: end; padding-bottom: .6rem; }
.f.chk input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; font-size: .87rem !important; line-height: 1.55; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .9rem; }
@media (max-width: 700px) { .row2, .row3 { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 1rem; align-items: center; }
.form-actions.sticky { position: sticky; bottom: 0; background: #f4f5f8; padding: .8rem 0; }
.narrow-box { max-width: 720px; }
.preview-img { border-radius: var(--r); margin-bottom: 1.2rem; width: 100%; aspect-ratio: 1; object-fit: cover; }
.dates { list-style: none; padding: 0; margin: 0 0 1rem; } .dates li { padding: .4rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.add-booking { margin-top: 1rem; } .add-booking summary { list-style: none; display: inline-flex; }
.row-form { grid-template-columns: repeat(4, 1fr) auto auto; align-items: end; margin-top: 1rem; }
@media (max-width: 900px) { .row-form { grid-template-columns: 1fr 1fr; } }
.swatches { display: flex; flex-wrap: wrap; gap: 1rem; }
.sw-in { display: grid; justify-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; }
.sw-in input { width: 64px; height: 48px; border: 1.5px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.md-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.md-split textarea { min-height: 520px; }
.lbl { font-weight: 650; font-size: .85rem; display: block; margin-bottom: .3rem; }
.md-preview { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.3rem; height: 520px; overflow: auto; font-size: .95rem; }
.md-preview img { max-width: 220px; display: inline-block; margin: .2rem; border-radius: 6px; }
.md-preview table { border-collapse: collapse; } .md-preview td, .md-preview th { border-bottom: 1px solid var(--line); padding: .3rem .6rem; text-align: left; }
@media (max-width: 1000px) { .md-split { grid-template-columns: 1fr; } }

/* calendar */
.month { font-size: 1.5rem; font-weight: 850; margin: 0 0 .8rem; }
.acal { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.acal .dh { padding: .4rem .6rem; font-size: .75rem; font-weight: 700; color: var(--mut); border-bottom: 1px solid var(--line); background: #fafbfc; }
.acal .c { min-height: 128px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem; }
.acal .c:nth-child(7n) { border-right: 0; }
.acal .pad { background: #f8f9fb; }
.acal .today { background: #fffaf0; }
.c-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: .85rem; padding: 0 .2rem .2rem; }
.today .c-top span { background: var(--red); color: #fff; border-radius: 999px; padding: 0 .45rem; }
.add { border: 0; background: none; font-size: 1.1rem; line-height: 1; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; color: var(--mut); opacity: 0; }
.c:hover .add, .add:focus-visible { opacity: 1; }
.add:hover { background: var(--ink); color: #fff; }
.acal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ev { display: block; font-size: .74rem; line-height: 1.25; padding: .25rem .35rem; border-radius: 4px; text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--pig) 18%, #fff); border-left: 3px solid var(--pig); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; padding-right: 2.2rem; }
.ev i { position: absolute; right: .3rem; font-style: normal; font-weight: 700; color: var(--mut); }
.ev:hover { background: color-mix(in srgb, var(--pig) 32%, #fff); }
.ev.cx { text-decoration: line-through; opacity: .55; }
.ev.draft { border-left-style: dashed; }
@media (max-width: 900px) { .acal { grid-template-columns: 1fr; } .acal .dh, .acal .pad { display: none; } .add { opacity: 1; } }
.dlg { border: 0; border-radius: 14px; padding: 1.6rem; width: min(640px, 94vw); box-shadow: 0 30px 80px rgba(9,19,51,.35); }
.dlg::backdrop { background: rgba(9,19,51,.45); }
.dlg h2 { margin: 0 0 .4rem; font-weight: 800; }
.dlg fieldset { border: 1.5px dashed #c9ccd8; border-radius: 10px; padding: .8rem 1rem 1rem; display: grid; gap: .8rem; }
.dlg legend { font-weight: 700; font-size: .85rem; padding: 0 .3rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; }

/* people, media, messages */
.ppl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.ppl a { display: grid; gap: .1rem; text-decoration: none; color: var(--ink); }
.ppl img, .ppl .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #eef0f5; margin-bottom: .4rem; display: block; }
.ppl small { color: var(--mut); }
.upload { display: flex; gap: 1rem; align-items: end; }
.media-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.media-grid li { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.media-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f0f1f4; }
.copy { width: 100%; border: 0; background: none; font: 500 .72rem var(--font); padding: .4rem .5rem; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mut); }
.copy.done { color: #2c5310; font-weight: 700; }
.msgs { list-style: none; padding: 0; margin: 0; }
.msgs li.dim { opacity: .6; }
.msg-h { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; } .msg-h small { margin-left: auto; color: var(--mut); }

/* login */
body.login { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
.login-card { background: #fff; border-radius: 16px; padding: 2.2rem; width: min(400px, 92vw); display: grid; gap: 1rem; }
.login-card img { margin: 0 auto .4rem; background: var(--ink); padding: .6rem 1rem; border-radius: 10px; }
.login-card h1 { margin: 0; font-size: 1.5rem; font-weight: 800; }
.login-card .b { justify-content: center; padding: .9rem; }
.login-card > a { text-align: center; font-size: .85rem; }
.err { background: #fbe1dc; color: #8f2615; padding: .6rem .8rem; border-radius: 8px; margin: 0; font-weight: 600; }

/* ---------- Ask Claude ---------- */
.ask { display: grid; grid-template-columns: 220px minmax(360px, 1fr) minmax(380px, 1.1fr); gap: 1rem; height: calc(100vh - 3.6rem); }
.ask-list { overflow: auto; }
.ask-list ul { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: 2px; }
.ask-list a { display: grid; padding: .55rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .88rem; line-height: 1.3; }
.ask-list a small { color: var(--mut); font-weight: 500; }
.ask-list a:hover { background: #fff; }
.ask-list a.is-on { background: #fff; box-shadow: inset 3px 0 0 var(--yellow); }
.ask-chat { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-height: 0; }
.ask-head { padding: 1rem 1.2rem .8rem; border-bottom: 1px solid var(--line); }
.ask-head h1 { font-size: 1.3rem; margin: 0 0 .2rem; font-weight: 800; display: flex; align-items: center; gap: .4rem; }
.ask-head h1 svg { color: #d39b0a; }
.ask-head p { margin: 0; font-size: .85rem; color: var(--mut); }
.ask-chat .flash { margin: .8rem 1rem 0; }
.ask-log { list-style: none; margin: 0; padding: 1rem 1.2rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 88%; padding: .7rem 1rem; border-radius: 14px; line-height: 1.5; font-size: .95rem; }
.msg p { margin: 0 0 .5em; } .msg p:last-child { margin: 0; } .msg ul, .msg ol { margin: .3em 0; padding-left: 1.2rem; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: #f4f5f8; border-bottom-left-radius: 4px; }
.msg.assistant.typing::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--mut); }
@keyframes blink { 50% { opacity: 0; } }
.tool { align-self: flex-start; font-size: .78rem; font-weight: 600; color: var(--mut); padding: .1rem .6rem .1rem 1.4rem; position: relative; }
.tool::before { content: ""; position: absolute; left: .4rem; top: .55em; width: .5rem; height: .5rem; border-radius: 50%; background: #c9ccd8; }
.tool.write { color: #2c5310; } .tool.write::before { background: var(--green); }
.tool.bad { color: #b3301c; } .tool.bad::before { background: var(--red); }
.working { align-self: flex-start; font-size: .82rem; color: var(--mut); display: flex; gap: .5rem; align-items: center; }
.working::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--yellow); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err-line { align-self: stretch; background: #fbe1dc; color: #8f2615; padding: .6rem .8rem; border-radius: 8px; font-size: .88rem; font-weight: 600; }
.hello p { color: var(--mut); margin: 0 0 .6rem; }
.sugg { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.sugg button { font: 550 .88rem var(--font); text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .8rem; cursor: pointer; color: var(--ink); width: 100%; }
.sugg button:hover { border-color: var(--ink); }
.ask-form { display: flex; gap: .6rem; padding: .8rem; border-top: 1px solid var(--line); align-items: flex-end; }
.ask-form textarea { flex: 1; font: 500 .95rem var(--font); resize: none; border: 1.5px solid #c9ccd8; border-radius: 12px; padding: .7rem .9rem; max-height: 200px; }
.ask-form textarea:focus { outline: none; border-color: var(--ink); }
.ask-form .b { padding: .85rem 1.3rem; }
.ask-form.is-busy .b { opacity: .5; pointer-events: none; }
.ask-preview { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-height: 0; }
.pv-bar { display: flex; gap: .4rem; padding: .5rem; border-bottom: 1px solid var(--line); background: #fafbfc; }
.pv-url { flex: 1; font: 500 .85rem var(--font); border: 1px solid var(--line); border-radius: 8px; padding: .35rem .6rem; }
.pv-frame { flex: 1; border: 0; width: 100%; }
@media (max-width: 1300px) { .ask { grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr); } .ask-list { display: none; } }
@media (max-width: 900px) { .ask { grid-template-columns: 1fr; height: auto; } .ask-chat { height: 75vh; } .ask-preview { height: 70vh; } }
.acal .c { min-width: 0; overflow: hidden; }
.acal .c ul { grid-template-columns: minmax(0, 1fr); }
