@import url("/tokens.css");
/*
 * Practice dashboard styles. Tokens follow Peregrine Office's console
 * (src/app/(app)/console/console.css) so Jason's design pack can replace them
 * in one place.
 */
:root {
  --ink: #141e28;
  --muted: #55677a;
  --faint: #8d9dab;
  --rule: #dfe5e9;
  --paper: #f4f7f5;
  --surface: #ffffff;
  --sunk: #e9efec;
  --fill: #155e63;
  --fill-deep: #0b2f34;
  --accent: #0e7078;
  --gold: #f2c230;
  --ok: #3f7a5e;
  --warn: #a3392b;
  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(13, 26, 38, 0.06), 0 8px 24px rgba(13, 26, 38, 0.06);
  --shadow-lg: 0 24px 64px rgba(13, 26, 38, 0.22);
  --ease: cubic-bezier(0.3, 1.3, 0.5, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --peri-font: var(--font);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--warn); font-size: 14px; }
.kicker { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }

/* --------------------------------- bits --------------------------------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--fill); color: #fff; font-weight: 600; cursor: pointer; transition: background 0.15s, transform 0.15s var(--ease); }
.btn:hover { background: var(--fill-deep); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn--quiet { background: var(--sunk); color: var(--fill-deep); }
.btn--quiet:hover { background: #dbe6e1; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--wide { width: 100%; }
.link { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: text-decoration-color 0.15s; }
.link:hover { text-decoration-color: currentColor; }
.link:disabled { color: var(--faint); cursor: default; }
.icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.icon:hover { background: var(--sunk); color: var(--ink); }
.icon--sm { width: 24px; height: 24px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill[data-tone="ok"] { background: #e3efe8; color: var(--ok); }
.pill[data-tone="warn"] { background: #f6e3df; color: var(--warn); }
.pill[data-tone="busy"] { background: #fbf1cf; color: #7a5a08; }
.pill[data-tone="busy"]::before { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.chip { padding: 7px 13px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.chip:hover { border-color: var(--accent); background: #f0f7f6; }
.chip[aria-pressed="true"] { border-color: transparent; background: var(--fill-deep); color: #fff; cursor: default; }
kbd { padding: 1px 6px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); font: 600 12px var(--font); }
input[type="text"], input[type="email"], input[type="password"], textarea { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--surface); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 112, 120, 0.15); }
:focus-visible { outline: 3px solid rgba(14, 112, 120, 0.4); outline-offset: 2px; }

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); }
.brand__mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--fill), var(--fill-deep)); position: relative; }
.brand__mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; background: #7fd3b4; transform: rotate(18deg); clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }

/* --------------------------------- sign in -------------------------------- */

.door { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, #dcebe6, var(--paper)); }
.door__card { width: min(400px, 100%); padding: 36px 28px 28px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); display: grid; gap: 18px; justify-items: center; text-align: center; }
.door__card h1 { font-size: 22px; letter-spacing: -0.02em; }
.door__card form { width: 100%; display: grid; gap: 14px; text-align: left; }
.door__card label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }

/* --------------------------------- overview ------------------------------- */

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px clamp(16px, 4vw, 40px); background: rgba(244, 247, 245, 0.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.bar__client { padding-left: 14px; border-left: 1px solid var(--rule); color: var(--muted); font-weight: 500; }
.bar__spacer { flex: 1; }
.bar__user { font-size: 14px; color: var(--muted); }

.page { max-width: 1180px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px) 140px; display: grid; gap: 36px; }
.hello { display: grid; gap: 8px; }
.hello h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.lede { color: var(--muted); max-width: 52ch; }
.notice.notice--warn { background: #fdecea; color: #6d2a20; }
.notice { padding: 14px 18px; border-radius: var(--r-sm); background: #fbf1cf; color: #5c4507; font-size: 14px; }

.grid { display: grid; gap: 18px; grid-template-columns: 2fr 1fr 1fr; }
.card { display: grid; align-content: start; gap: 10px; padding: 22px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.card h2 { font-size: 15px; font-weight: 600; }
.card--site { grid-row: span 1; }
.card__head, .card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__foot a { color: var(--muted); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__foot a:hover { color: var(--accent); }
.figure { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.figure small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.meter { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #7fd3b4); transition: width 0.6s var(--ease); }
.thumb { position: relative; height: 250px; border-radius: var(--r-sm); overflow: hidden; background: var(--sunk); }
.thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; border: 0; transform: scale(0.25); transform-origin: 0 0; pointer-events: none; }

.section-title { font-size: 17px; letter-spacing: -0.01em; margin-bottom: 14px; }
.tools { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tool { display: grid; gap: 6px; align-content: start; justify-items: start; padding: 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.tool h3 { font-size: 15px; }
.tool .btn, .tool .link { margin-top: 8px; }
.tool--off { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
.tool--off h3 { color: var(--muted); }

.split { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow); }
.list li > div { flex: 1; min-width: 0; }
.list__title { font-weight: 600; overflow-wrap: anywhere; }
.list .list__empty { display: block; background: transparent; box-shadow: inset 0 0 0 1px var(--rule); color: var(--muted); font-size: 14px; }
.list .list__form { display: block; }

.fatal { position: fixed; inset: auto 16px 16px; padding: 14px 18px; border-radius: var(--r-sm); background: var(--warn); color: #fff; }

.people { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; align-items: start; }
.person__you { margin-left: 6px; color: var(--muted); font-weight: 500; }
.invite form { display: grid; gap: 10px; }
.invite label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
.invite .btn { justify-self: start; }
.invite__done { display: grid; gap: 10px; }
.invite__link { display: flex; gap: 8px; }
.invite__link input { flex: 1; min-width: 0; font-size: 13px; }
.small { font-size: 13px; }

/* the invitation page */
.door__card--wide { width: min(460px, 100%); }
.door__card section { width: 100%; display: grid; gap: 14px; justify-items: center; }
.steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 12px; font-weight: 600; color: var(--faint); }
.steps li { padding: 4px 10px; border-radius: 999px; background: var(--sunk); }
.steps li[aria-current="step"] { background: var(--fill-deep); color: #fff; }
.qr { padding: 8px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--rule); line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.manual { width: 100%; text-align: left; font-size: 14px; }
.manual summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.manual p { margin-top: 8px; }
.secret { font: 600 15px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.06em; word-break: break-all; padding: 10px 12px; border-radius: 10px; background: var(--sunk); color: var(--ink); }

/* ------------------------------- Peri's corner ----------------------------- */

.dock { position: fixed; right: clamp(12px, 3vw, 32px); bottom: clamp(8px, 2vw, 20px); z-index: 20; }
.dock peri-mascot { --peri-size: 104px; filter: drop-shadow(0 10px 18px rgba(13, 26, 38, 0.18)); }

/* -------------------------------- workspace -------------------------------- */
/* The live site fills the page. Peri and his chat bubble float over it. */

.work { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto 1fr; background: #0f1a22; animation: fade 0.25s ease-out; }
.work__bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--fill-deep); color: #fff; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.back:hover { background: rgba(255, 255, 255, 0.18); }
.work__url { flex: 0 1 auto; min-width: 0; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.8); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work__hint { flex: 1; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work__hint kbd { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.12); color: #fff; }
.toggle { min-height: 32px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px; background: none; color: rgba(255, 255, 255, 0.85); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.toggle:hover { background: rgba(255, 255, 255, 0.1); }
.toggle[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: #3a2c02; }
.work .seg { background: rgba(255, 255, 255, 0.1); }
.work .seg button { color: rgba(255, 255, 255, 0.75); }
.work .seg button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunk); }
.seg button { padding: 5px 12px; border: 0; border-radius: 999px; background: none; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.work__stage { position: relative; min-height: 0; display: grid; place-items: stretch; }
.work__stage iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width 0.35s var(--ease); }
.work__stage[data-size="phone"] { place-items: center; padding: 20px 0; }
.work__stage[data-size="phone"] iframe { width: 390px; max-width: 100%; border-radius: 32px; box-shadow: 0 0 0 10px #05090c, var(--shadow-lg); }
.work__wait { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(244, 247, 245, 0.96); color: var(--muted); font-weight: 500; text-align: center; padding: 24px; }

/* A link on the site that would leave the preview: offered here instead. */
.linknote { position: absolute; left: 50%; bottom: 22px; z-index: 3; display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100% - 32px)); padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); transform: translateX(-50%); animation: pop 0.25s var(--ease); font-size: 14px; }
.linknote p { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linknote span { color: rgba(255, 255, 255, 0.72); }
.linknote .btn { background: var(--gold); color: #3a2c02; text-decoration: none; }
.linknote .icon { color: rgba(255, 255, 255, 0.7); }
.linknote .icon:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* Peri in the workspace. JavaScript sets --x/--y; the transition is the flight. */
.flyer { position: fixed; left: 0; top: 0; z-index: 32; width: 88px; transform: translate(var(--x, 0px), var(--y, 0px)); transition: transform 0.8s cubic-bezier(0.45, 0, 0.2, 1); filter: drop-shadow(0 12px 18px rgba(5, 12, 18, 0.35)); will-change: transform; }
.flyer peri-mascot { --peri-size: 88px; display: block; }
.flyer.is-flying peri-mascot { animation: arc 0.8s ease-in-out; }
.flyer.is-following { transition: none; }
@keyframes arc { 50% { transform: translateY(-46px) scale(1.06); } }

/* The chat bubble. It opens beside Peri and closes when the job is done. */
.talk { position: fixed; left: 0; top: 0; z-index: 31; width: min(360px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px)); display: grid; grid-template-rows: auto 1fr auto; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(13, 26, 38, 0.08); transform: translate(var(--x, 0px), var(--y, 0px)); transform-origin: var(--ox, 100%) var(--oy, 100%); animation: bloom 0.3s var(--ease); }
.talk.is-following { transition: none; }
.talk.is-leaving { animation: wilt 0.2s ease-in forwards; }
@keyframes bloom { from { opacity: 0; scale: 0.86; } }
@keyframes wilt { to { opacity: 0; scale: 0.9; } }
.talk__head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 10px 8px 18px; }
.talk__head > div { flex: 1; min-width: 0; }
.talk__head h2 { font-size: 16px; letter-spacing: -0.01em; }
.talk__head .muted { font-size: 13px; overflow-wrap: anywhere; }
.talk__body { min-height: 0; overflow-y: auto; padding: 4px 18px 12px; display: flex; flex-direction: column; gap: 10px; }
.talk__body:empty { display: none; }
.talk__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--rule); }
.talk__form textarea { flex: 1; resize: none; scrollbar-width: none; min-height: 44px; max-height: 120px; border-radius: 20px; padding: 11px 15px; line-height: 1.4; }
.talk__form .btn { width: 44px; height: 44px; min-height: 0; padding: 0; flex: none; }

.msg { max-width: 92%; padding: 9px 13px; border-radius: 16px; animation: pop 0.28s var(--ease); overflow-wrap: anywhere; font-size: 14.5px; }
.msg--peri { align-self: flex-start; background: var(--sunk); border-bottom-left-radius: 6px; }
.msg--you { align-self: flex-end; background: var(--fill); color: #fff; border-bottom-right-radius: 6px; }
.msg--note { align-self: center; max-width: 100%; padding: 6px 12px; background: #e3efe8; color: var(--ok); font-size: 13px; font-weight: 600; }
.msg--card { align-self: stretch; max-width: 100%; display: grid; gap: 10px; padding: 0; background: none; animation: none; }
.card__title { font-weight: 700; }
.diff { display: grid; gap: 6px; }
.diff__label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.diff__was, .diff__now { padding: 8px 10px; border-radius: 10px; font-size: 14px; }
.diff__was { background: #f6e3df; color: #6d2a20; text-decoration: line-through; text-decoration-color: rgba(109, 42, 32, 0.45); }
.diff__now { background: #e3efe8; color: #21503b; }
.diff__pics { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; color: var(--muted); }
.diff__pics img, .diff__pics .tile { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--sunk); }
.diff__pics > :first-child { opacity: 0.55; }

.codeform { display: grid; gap: 6px; }
.codeform__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code { width: 9.5em !important; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; text-align: center; }
.code::placeholder { letter-spacing: 0; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }

/* Choosing a picture: the site's library, pictures added before, and a tile to add a new one. */
.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pic { position: relative; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: var(--sunk); cursor: pointer; aspect-ratio: 1; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic:hover { border-color: var(--accent); }
.pic[aria-current="true"] { border-color: var(--gold); cursor: default; }
.pic[aria-current="true"]::after { content: "Now"; position: absolute; left: 6px; top: 6px; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: #3a2c02; font-size: 11px; font-weight: 700; }
.tile { display: grid; place-items: center; gap: 2px; padding: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.pic--add { border: 2px dashed var(--rule); background: none; }
.pic--add:hover { background: #f0f7f6; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
@keyframes dot { 50% { transform: translateY(-4px); opacity: 0.4; } }

/* --------------------------------- smaller -------------------------------- */

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card--site { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
  .people { grid-template-columns: 1fr; }
  .work__hint { display: none; }
  .work__url { flex: 1; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .bar__client, .bar__user { display: none; }
  .dock peri-mascot { --peri-size: 84px; }
  .seg { display: none; }
  .flyer, .flyer peri-mascot { width: 68px; --peri-size: 68px; }
  .work__url { display: none; }
  .work__bar { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Authenticated website editor inside the client workshop. */
body.peri-embedded > .bar, body.peri-embedded #page, body.peri-embedded #dock, body.peri-embedded #back-next { display: none !important; }
body.peri-embedded { min-width: 0; background: var(--paper); }
body.peri-embedded .work { inset: 0; border-radius: 0; }
body.peri-embedded [data-close-peri] { display: none; }
.website-away { position: fixed; z-index: 35; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; background: var(--entry-ink); color: var(--entry-paper); box-shadow: var(--entry-shadow); }
.website-away[hidden] { display: none; }
.website-away__clock { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.website-away div { display: grid; gap: 2px; }
.website-away b { font: 500 20px/1.2 var(--entry-mono); font-variant-numeric: tabular-nums; }
.website-away div span { font-size: 12px; }
@media (max-width: 560px) { .website-away { right: 12px; bottom: 12px; padding: 12px; } }
