/* Cloudkeep: one small book on the sky. Cloth cover, cream paper, real torn photos (assets/photo-*.webp, logo-paper.png). */

:root {
  --ink: #17364b; --text: #28475a; --muted: #6c7e85; --faint: #8b9b9e; --blue: #30658b; --blue-hover: #174a6d;
  --paper: #fbf8f0; --paper-2: #f6f1e5; --rule: rgba(66, 58, 38, .14); --line: rgba(39, 77, 91, .16); --soft: #ece9df;
  --green: #3f7d5f; --green-bg: #e2ece2; --red: #a33a2c;
  --serif: "Newsreader", Georgia, serif; --sans: "DM Sans", Arial, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  /* page size: as tall as the window allows, never wider than half the window */
  --ph: clamp(540px, calc(100dvh - 172px), 760px);
  --pw: min(calc(var(--ph) * .76), calc((100vw - 76px) / 2));
  --pad: clamp(30px, calc(var(--pw) * .085), 50px);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); font-family: var(--sans); font-size: 14px; background: #9bc5df; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid #3d89c1; outline-offset: 2px; }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); }
.world { position: fixed; inset: 0; z-index: -1; background: #8ebdde url("https://images.unsplash.com/photo-1747135086469-cf1851f10cf9?fm=jpg&ixlib=rb-4.1.0&q=80&w=2400") center/cover; }
.world::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(255, 255, 255, .1), rgba(20, 50, 70, .16)); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; padding: 10px 16px; font-size: 13px; font-weight: 600; white-space: nowrap;
       transition: background .18s, transform .18s, box-shadow .18s; }
.btn-dark { background: var(--blue); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 14px -8px rgba(23, 54, 75, .7); }
.btn-dark:hover:not(:disabled) { background: var(--blue-hover); }
.btn-dark:active:not(:disabled) { transform: translateY(1px); }
.btn-plain { border: 1px solid #ddd6c5; background: #fffdf7; color: var(--ink); } .btn-plain:hover { background: #f4efe2; }
.btn:disabled { opacity: .55; cursor: default; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.code { background: var(--green-bg); color: var(--green); font-family: var(--mono); letter-spacing: .05em; }
.pill.tag { background: var(--soft); color: #5d6a6e; font-family: var(--mono); font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4c9675; display: inline-block; flex: none; box-shadow: 0 0 0 3px rgba(76, 150, 117, .16); }
.dot.off { background: #b9b6ab; box-shadow: none; }
.demo { display: inline-block; font: 700 9px/1 var(--sans); letter-spacing: .12em; color: #8a5a17; border: 1px solid #d9b77a; background: #fbf0d7;
        padding: 3px 5px 2px; border-radius: 4px; vertical-align: 1px; margin-left: 6px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #17364b; color: #fff; padding: 11px 17px; border-radius: 10px;
         font-size: 13px; z-index: 50; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); }

/* ---------- stage and book ---------- */
.stage { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 32px; padding: 74px 20px 16px; }
.book { position: relative; width: calc(var(--pw) * 2); height: var(--ph); perspective: 3400px; perspective-origin: 50% 45%;
        animation: book-in .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes book-in { from { opacity: 0; transform: translateY(22px) scale(.985); } }

/* the cloth cover, a little larger than the pages */
.cover { position: absolute; inset: -13px -15px -17px; border-radius: 7px; background-color: #33546a;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 22px), rgba(8, 22, 32, .38) 50%, transparent calc(50% + 22px)),
    linear-gradient(180deg, rgba(255, 255, 255, .09), transparent 30%, rgba(0, 0, 0, .14)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -2px 3px rgba(0, 0, 0, .25),
              0 46px 70px -24px rgba(9, 27, 40, .62), 0 18px 30px -12px rgba(9, 27, 40, .42), 0 3px 6px rgba(9, 27, 40, .25); }

/* satin ribbon hanging out at the bottom */
.ribbon { position: absolute; left: calc(var(--pw) * 2 - 70px); top: calc(var(--ph) - 6px); width: 15px; height: 58px; z-index: 0;
  background: linear-gradient(90deg, #7c2f2a, #a8473e 45%, #8b3530 70%, #6c2723);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%); filter: drop-shadow(0 4px 3px rgba(10, 25, 35, .3)); transform: rotate(-3deg); transform-origin: top; }

/* paper */
.page { position: absolute; top: 0; width: var(--pw); height: var(--ph); background-color: var(--paper); overflow: hidden; z-index: 1; color: var(--ink); }
.page::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3; mix-blend-mode: multiply; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .25 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"); }
.page.left { left: 0; border-radius: 4px 1px 1px 4px;
  background-image: linear-gradient(to left, rgba(74, 58, 28, .26), rgba(74, 58, 28, .09) 14px, rgba(74, 58, 28, .03) 46px, transparent 90px),
                    linear-gradient(to right, rgba(110, 96, 64, .10), transparent 8px);
  box-shadow: -1px 1px 0 #e7dfcc, -2px 2px 0 #fbf7ee, -3px 3px 0 #e3dbc7, -4px 4px 0 #f8f3e7, -5px 5px 0 #ddd4bf, -6px 6px 0 #f3eddf, -7px 7px 0 #d6ccb6; }
.page.right { left: var(--pw); border-radius: 1px 4px 4px 1px;
  background-image: linear-gradient(to right, rgba(74, 58, 28, .26), rgba(74, 58, 28, .09) 14px, rgba(74, 58, 28, .03) 46px, transparent 90px),
                    linear-gradient(to left, rgba(110, 96, 64, .10), transparent 8px);
  box-shadow: 1px 1px 0 #e7dfcc, 2px 2px 0 #fbf7ee, 3px 3px 0 #e3dbc7, 4px 4px 0 #f8f3e7, 5px 5px 0 #ddd4bf, 6px 6px 0 #f3eddf, 7px 7px 0 #d6ccb6; }

.page-in { position: relative; z-index: 1; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
.run, .folio { display: flex; justify-content: space-between; align-items: center; padding: 0 var(--pad); color: #a39a85; }
.run { height: 46px; font-size: 9.5px; letter-spacing: .22em; font-weight: 600; text-transform: uppercase; }
.folio { height: 40px; font: italic 400 15px var(--serif); }
.right .run, .right .folio { flex-direction: row-reverse; }
.page-body { overflow-y: auto; padding: 4px var(--pad) 10px; scrollbar-width: thin; scrollbar-color: #d9d1bd transparent; }
.left .page-body { padding-right: calc(var(--pad) + 6px); }
.right .page-body { padding-left: calc(var(--pad) + 6px); }

.overline { display: block; color: #8c7f62; font-size: 10px; letter-spacing: .2em; font-weight: 700; margin: 0 0 12px; }
.page h1, .page h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.035em; color: #17394e; margin: 0; }
.page h1 em, .page h2 em { font-style: italic; }
.lede { color: #5b6e75; line-height: 1.65; margin: 0; }

/* torn photos and tape */
.taped { position: relative; display: inline-block; }
.tape { position: absolute; width: 74px; height: 22px; background: rgba(239, 230, 205, .78); box-shadow: 0 1px 2px rgba(80, 60, 20, .14);
        clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 45%); backdrop-filter: blur(.5px); }
.photo { display: block; filter: drop-shadow(0 6px 8px rgba(40, 32, 15, .2)) drop-shadow(0 1px 1px rgba(40, 32, 15, .18)); }

/* ---------- page 1: agent setup ---------- */
.setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(10px, 1.6vh, 18px); padding-bottom: 4px; }
.setup .brand { width: clamp(116px, calc(var(--pw) * .26), 150px); transform: rotate(-2.2deg); margin: 2px 0 0 -6px; }
.setup .brand .tape { top: -9px; left: 38%; transform: rotate(4deg); }
.setup h1 { font-size: clamp(26px, calc(var(--ph) * .047), 35px); line-height: 1.05; }
.setup .lede { font-size: 13.5px; }
/* the setup slip is a notebook page with index tabs on top: one tab per agent */
.notebook { transform: rotate(-.35deg); }
.tabs { display: flex; align-items: flex-end; padding: 0 0 0 10px; position: relative; z-index: 1; margin-bottom: -1px; }
.agent-tabs { display: flex; gap: 3px; align-items: flex-end; }
.tab { white-space: nowrap; padding: 6px 11px 5px; font-size: 11.5px; font-weight: 600; color: #7d7259; background: #eee6d2; border: 1px solid #e0d6bd; border-bottom-color: #e8e0cd;
       border-radius: 7px 7px 0 0; transition: background .15s, color .15s; }
.tab:hover { background: #f5efe0; color: var(--ink); }
.tab.on { background: #fffdf8; color: var(--ink); border-color: #e8e0cd; border-bottom-color: #fffdf8; padding-top: 8px; box-shadow: 0 -3px 8px -6px rgba(60, 46, 18, .35); }
.os { display: inline-flex; gap: 2px; padding: 2px; background: #f0ebde; border-radius: 7px; }
.os button { padding: 4px 9px; border-radius: 5px; font-size: 11px; color: #6a6553; } .os button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px #e2dac6; }
.agent-tabs { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.agent-tabs::-webkit-scrollbar { display: none; }
.tab.add { display: grid; place-items: center; padding: 6px 9px 5px; color: var(--blue); }
.tab.add svg.i { width: 14px; height: 14px; }
.tab.news::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-left: 6px; vertical-align: 2px; }
.pick { display: grid; gap: 4px; margin-bottom: 10px; }
.pick label { font-size: 10px; letter-spacing: .18em; font-weight: 700; color: #8c7f62; text-transform: uppercase; }
.pick-row { display: flex; gap: 10px; }
.pick select, .pick input { height: 34px; min-width: 0; border: 0; border-bottom: 1px solid #cfc6b0; background-color: transparent; padding: 0 2px;
  font: 600 14px var(--sans); color: var(--ink); outline: 0; border-radius: 0; }
.pick select { flex: 1; appearance: none; cursor: pointer; padding-right: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2330658b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 2px center / 16px no-repeat; }
.pick input { flex: 1; }
.pick select:focus, .pick input:focus { border-bottom-color: var(--blue); box-shadow: 0 1px 0 var(--blue); }
.notebook .exlibris.slip { border-color: #e8e0cd; border-radius: 3px 8px 6px 6px; padding: 14px 16px 13px;
  box-shadow: inset 0 0 0 3px #fffdf8, inset 0 0 0 4px #ece4d0, 0 10px 22px -12px rgba(60, 46, 18, .35), 0 1px 2px rgba(60, 46, 18, .12); }
.back-to { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; align-self: flex-start; }
.back-to svg.i { width: 14px; height: 14px; }
.phone-note { display: none; }
.slip-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.slip-foot .os { flex: none; }
.slip-foot .btn { flex: 1; min-width: 140px; }
.slip { position: relative; padding: 14px 15px 13px; background: #fffdf8; border: 1px solid #e8e0cd; border-radius: 3px 8px 6px 6px;
        box-shadow: 0 10px 22px -12px rgba(60, 46, 18, .35), 0 1px 2px rgba(60, 46, 18, .12); }
.slip code { display: block; font: 11.5px/1.6 var(--mono); color: var(--text); word-break: break-word; margin-bottom: 11px; }
.slip code mark { background: linear-gradient(transparent 55%, rgba(149, 198, 226, .45) 55%); color: inherit; }
.slip .btn { height: 38px; }
.claude-coming-soon { display: grid; gap: 14px; padding: 26px 22px; }
.claude-coming-soon h2 { font: 400 clamp(36px, 4vw, 48px)/1.05 var(--serif); color: var(--ink); }
.claude-coming-soon p { font-size: 13.5px; line-height: 1.65; color: var(--text); }
.claude-coming-soon .fine { margin: 0; font-size: 11.5px; color: #978d76; }
/* the same note at the top right of the inbox */
.update-flag { position: fixed; top: 16px; right: 18px; z-index: 6; width: 280px; display: grid; gap: 7px; padding: 13px 15px 12px;
  background: #fbf0d7; border: 1px solid #ecd6a6; border-radius: 4px 9px 7px 4px; color: #7a5a1e; font-size: 12px; line-height: 1.5;
  transform: rotate(.6deg); box-shadow: 0 12px 22px -10px rgba(9, 27, 40, .5), 0 2px 4px rgba(9, 27, 40, .15); animation: fade-in .4s ease both; }
.update-flag b { font: italic 400 17px var(--serif); color: #5e4210; }
.update-flag div { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.update-flag .btn { height: 32px; padding: 0 12px; font-size: 12px; }
@media (max-width: 700px) { .update-flag { display: none; } }
.stage.on-phone .update-flag, .stage.on-setup .update-flag { display: none; }
/* "set up before? paste it again": a small amber note under the Claude sentence */
.update-note { margin: 0; padding: 8px 11px; font-size: 12px; line-height: 1.5; color: #7a5a1e; background: #fbf0d7; border: 1px solid #ecd6a6; border-radius: 6px; }
.update-note strong { color: #5e4210; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.steps li { display: grid; grid-template-columns: 24px 1fr; gap: 6px; font-size: 12.5px; line-height: 1.45; color: #4d5f66; }
.steps li b { font: italic 400 16px/1.2 var(--serif); color: #9b8e70; }
.steps strong { color: var(--ink); font-weight: 600; }

/* ---------- page 2: sign in ---------- */
.login { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 0 8px; position: relative; }
.login .stamp { position: absolute; top: 2px; right: -8px; width: clamp(108px, calc(var(--pw) * .27), 140px); transform: rotate(5deg); }
.login .stamp .tape { top: -8px; left: 22%; width: 58px; transform: rotate(-9deg); }
.login h2 { font-size: clamp(36px, calc(var(--pw) * .088), 48px); line-height: 1.02; margin-bottom: 10px; }
.login .lede { font-size: 13.5px; margin-bottom: 26px; max-width: 30ch; }
.login form { display: grid; gap: 18px; }
.field { display: grid; gap: 4px; }
.field span { font-size: 10px; letter-spacing: .18em; font-weight: 700; color: #8c7f62; text-transform: uppercase; }
.field input { height: 40px; border: 0; border-bottom: 1px solid #cfc6b0; background: transparent; padding: 0 2px; font-size: 15px; color: var(--ink); outline: 0; border-radius: 0;
               transition: border-color .2s, box-shadow .2s; }
.field input::placeholder { color: #b9b19c; }
.field input:focus { border-bottom-color: var(--blue); box-shadow: 0 1px 0 var(--blue); }
.field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--paper) inset; -webkit-text-fill-color: var(--ink); }
.err { color: var(--red); font-size: 12.5px; margin: -6px 0 -4px; min-height: 0; }
.err:empty { display: none; }
.login .btn-dark { height: 46px; margin-top: 6px; font-size: 14px; }
.login .btn-dark svg.i { transition: transform .2s; } .login .btn-dark:hover svg.i { transform: translateX(3px); }
.fine { font-size: 11.5px; color: #978d76; line-height: 1.6; margin: 22px 0 0; }
.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- page 3: inbox ---------- */
.inbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.exlibris { position: relative; padding: 14px 16px 13px; border: 1px solid #d8ceb5; border-radius: 3px; text-align: center;
            box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px #e3dac4; }
.exlibris small { display: block; font: italic 400 13px var(--serif); color: #9b8e70; margin-bottom: 4px; }
.exlibris .addr { display: inline-flex; align-items: center; gap: 8px; font: 500 14px var(--mono); color: var(--ink); max-width: 100%; border-radius: 6px; padding: 3px 6px; }
.exlibris .addr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exlibris .addr:hover { background: #f1ecdf; } .exlibris .addr svg.i { color: #9b8e70; }
.agent { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11.5px; color: #66777c; margin-top: 7px; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.list-head h2 { font-size: 26px; } .list-head h2:focus { outline: none; }
.list-head h2 small { font: 600 10px var(--sans); letter-spacing: .16em; color: #9b8e70; margin-left: 8px; vertical-align: 4px; }
.list-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.link-btn { font-size: 11.5px; font-weight: 600; color: var(--blue); text-decoration: underline; text-decoration-color: #9fbfd4; text-underline-offset: 3px; }
.link-btn:hover { color: var(--blue-hover); }
.mails { list-style: none; margin: -8px 0 0; padding: 0; }
.mail-row { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left;
            padding: 11px 8px; margin: 0 -8px; width: calc(100% + 16px); border-bottom: 1px solid var(--rule); border-radius: 4px; transition: background .15s; }
.mail-row:hover { background: rgba(214, 203, 176, .22); }
.mail-row.on { background: rgba(149, 198, 226, .2); box-shadow: inset 3px 0 0 var(--blue); }
.mail-row .who { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #ece6d6; color: #5a5440; font: 18px var(--serif); }
.mail-row .mr { display: grid; gap: 2px; min-width: 0; }
.mail-row .mr b { font-size: 12px; font-weight: 600; color: #4f6067; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row .mr span { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.unread .mr span { font-weight: 700; }
.mail-row .side { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: #8b8a80; }
.mail-row.unread time::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; }
.blank { padding: 22px 0 8px; color: #6e7a7b; line-height: 1.7; font-size: 13px; }
.blank b { display: block; font: italic 400 24px var(--serif); color: var(--ink); margin-bottom: 4px; letter-spacing: -.02em; }
.signout { justify-self: start; }

/* ---------- page 4: the email ---------- */
.letter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-bottom: 8px; }
.letter h2 { font-size: clamp(25px, calc(var(--pw) * .058), 32px); line-height: 1.1; overflow-wrap: anywhere; }
.meta { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; font-size: 12.5px; color: #5b6e75; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.meta b { color: var(--ink); font-weight: 600; } .meta div > div { margin-top: 2px; font-size: 11.5px; color: #8b8a80; }
.tools { display: flex; gap: 4px; align-items: center; flex: none; }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: #f0ebde; border-radius: 7px; }
.seg button { padding: 4px 9px; border-radius: 5px; font-size: 11px; color: #6a6553; } .seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px #e2dac6; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: #6a6553; } .icon-btn:hover { background: #efe9da; color: var(--red); }
.found { display: grid; gap: 8px; padding: 12px 13px; background: rgba(226, 236, 226, .55); border: 1px dashed #b9cfbd; border-radius: 6px; }
.found > small { font-size: 10px; letter-spacing: .16em; font-weight: 700; color: var(--green); }
.found-row { display: flex; gap: 8px; flex-wrap: wrap; }
.found .code { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 7px; background: #fff; color: var(--green); border: 1px solid #c9dccb;
               font: 600 15px var(--mono); letter-spacing: .08em; }
.found .btn { max-width: 100%; height: 34px; padding: 0 12px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.found .btn span { overflow: hidden; text-overflow: ellipsis; }
.mail-frame { width: 100%; min-height: 240px; border: 0; display: block; background: transparent; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font: 13.5px/1.7 var(--sans); margin: 0; color: var(--text); }
.mail-text a { color: var(--blue); }
.links { border-top: 1px solid var(--rule); padding-top: 8px; }
.links summary { cursor: pointer; font-size: 11.5px; font-weight: 600; color: #6a6553; list-style: none; display: flex; gap: 7px; align-items: center; padding: 4px 0; }
.links summary::-webkit-details-marker { display: none; }
.links a { display: grid; padding: 7px 0; border-top: 1px dotted var(--rule); text-decoration: none; min-width: 0; font-size: 12.5px; }
.links a:hover span { text-decoration: underline; } .links a > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links small { font: 10.5px var(--mono); color: var(--faint); }
.nothing { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; padding-bottom: 20px; color: #6e7a7b; }
.nothing .taped { width: min(78%, 260px); transform: rotate(-1.6deg); }
.nothing .tape { top: -9px; left: 40%; transform: rotate(-3deg); }
.nothing b { font: italic 400 26px var(--serif); color: var(--ink); letter-spacing: -.02em; }
.nothing p { margin: 0; font-size: 13px; line-height: 1.7; max-width: 32ch; }
.fade-in { animation: fade-in .35s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- the turning page (built in app.js) ---------- */
.flipper { position: absolute; top: 0; left: var(--pw); width: var(--pw); height: var(--ph); z-index: 5; transform-style: preserve-3d; transform: translateZ(.6px); pointer-events: none; }
.strip { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; transform-origin: 0 50%; will-change: transform; }
.flipper > .strip { left: 0; } .strip > .strip { left: 100%; }
.face { position: absolute; top: 0; left: 0; height: 100%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; outline: 1px solid transparent; }
.face.back { transform: rotateY(180deg); }
.face > .page { box-shadow: none; }
.face > .page .page-body { overflow: hidden; }
.face .shade { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.cast { position: absolute; top: 0; height: var(--ph); width: 120px; z-index: 4; pointer-events: none; opacity: 0; }
.book.turning .page { pointer-events: none; }

/* ---------- bubbles behind the book ---------- */
.bubbles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.book, .foot, .phone-note { position: relative; z-index: 1; }
.bubble { position: absolute; bottom: -70px; width: var(--size); height: var(--size); border-radius: 50%; pointer-events: auto; cursor: pointer;
  animation: bubble-rise var(--rise) linear infinite;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 5%, rgba(255, 255, 255, .3) 9%, transparent 22%),
    radial-gradient(circle at 68% 76%, rgba(255, 255, 255, .35), transparent 26%),
    radial-gradient(circle, rgba(190, 230, 255, .05) 58%, rgba(150, 210, 255, .28) 74%, rgba(255, 255, 255, .5) 80%, transparent 83%);
  box-shadow: inset 2px -3px 7px rgba(255, 170, 225, .22), inset -3px 2px 7px rgba(120, 230, 255, .3), 0 2px 6px rgba(20, 60, 90, .06); }
@keyframes bubble-rise {
  0% { transform: translate3d(0, 0, 0) scale(.9); opacity: 0; }
  8% { opacity: .9; }
  50% { transform: translate3d(var(--drift), -55vh, 0) scale(1); }
  90% { opacity: .8; }
  100% { transform: translate3d(calc(var(--drift) * -1), -115vh, 0) scale(1.05); opacity: 0; }
}

/* popping a bubble: a ring and a few droplets */
.burst { position: fixed; pointer-events: none; z-index: 0; }
.burst .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 0 6px rgba(150, 215, 255, .6); animation: ring-out .32s ease-out forwards; }
.burst i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%;
  background: rgba(255, 255, 255, .95); box-shadow: 0 0 3px rgba(140, 210, 255, .8); animation: droplet .45s ease-out forwards; }
@keyframes ring-out { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@keyframes droplet { from { transform: rotate(var(--a)) translateX(0); opacity: 1; } to { transform: rotate(var(--a)) translateX(var(--d)) scale(.4); opacity: 0; } }

/* ---------- the switch at the top: the book or AgentPhone ---------- */
.switch { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: 3px; padding: 4px;
  background: rgba(251, 248, 240, .94); border: 1px solid #fff; border-radius: 99px;
  box-shadow: 0 10px 22px -10px rgba(9, 27, 40, .5), 0 2px 4px rgba(9, 27, 40, .15); }
.switch button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px 0 13px; border-radius: 99px;
  font-size: 13px; font-weight: 600; color: #6f6650; transition: background .18s, color .18s; }
.switch button:hover { color: var(--ink); background: #f1ecdf; }
.switch button.on { background: var(--blue); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 10px -6px rgba(23, 54, 75, .8); }
.stage.on-phone .book, .stage.on-phone > .foot, .stage:not(.on-phone) #phone-mount { display: none; }
/* AgentPhone isn't open to everyone yet: the switch only shows once someone opens /#phone. */
.stage:not(.on-phone):not(.phone-known) .switch { display: none; }
#phone-mount { position: relative; z-index: 1; }
/* the setup page on the phone itself (from the pairing QR code): only that, on every screen size */
.stage:not(.on-setup) #setup-mount { display: none; }
.stage.on-setup > :not(#setup-mount):not(.bubbles) { display: none !important; }
#setup-mount { position: relative; z-index: 1; width: 100%; display: grid; justify-items: center; }

/* ---------- footer ---------- */
/* a small cream label on the grass, like a note tucked under the book */
.foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 16px; text-align: center; padding: 10px 22px 9px;
        background: #fbf8f0; border: 1px solid #fff; border-radius: 3px 8px 6px 3px; transform: rotate(-.6deg); color: var(--ink);
        box-shadow: 0 12px 22px -10px rgba(9, 27, 40, .55), 0 2px 4px rgba(9, 27, 40, .2); }
.foot em { font: italic 400 21px/1.2 var(--serif); letter-spacing: -.01em; color: #17394e; }
.foot span { font-size: 13px; font-weight: 600; color: #6f6650; }
/* the little music player at the top left: a cream label with a glossy aqua button */
.player { position: fixed; top: 16px; left: 18px; z-index: 6; display: flex; align-items: center; gap: 11px; padding: 8px 14px 8px 8px; max-width: 280px;
  background: rgba(251, 248, 240, .94); border: 1px solid #fff; border-radius: 99px; color: var(--ink);
  box-shadow: 0 10px 22px -10px rgba(9, 27, 40, .5), 0 2px 4px rgba(9, 27, 40, .15); }
.player .play { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 50% 28%, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 46%), linear-gradient(#5fb8ea, #1f73b7);
  box-shadow: inset 0 -2px 5px rgba(8, 50, 90, .35), inset 0 1px 1px rgba(255, 255, 255, .8), 0 3px 8px rgba(20, 90, 150, .35); }
.player .play:hover { filter: brightness(1.06); } .player .play:active { transform: translateY(1px); }
.player .play svg { width: 16px; height: 16px; fill: currentColor; filter: drop-shadow(0 1px 1px rgba(0, 40, 80, .35)); }
.player .track { display: grid; min-width: 0; line-height: 1.25; }
.player small { font-size: 9px; letter-spacing: .16em; font-weight: 700; color: #8c7f62; text-transform: uppercase; }
.player b { font: italic 400 15px var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player span { font-size: 10.5px; color: #8b8a80; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player.on small::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #4c9675; margin-right: 6px; vertical-align: 1px;
  animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.player.mini { padding: 6px; gap: 0; }
.player.mini .track { width: 0; overflow: hidden; transition: width .25s; }
.player.mini:hover, .player.mini:focus-within { padding: 8px 14px 8px 8px; gap: 11px; }
.player.mini:hover .track, .player.mini:focus-within .track { width: 190px; }
@media (max-width: 700px) { .player, .switch, #phone-mount { display: none !important; } .stage { padding-top: 28px; } }
.stage.on-setup { padding-top: 28px; }

/* ---------- short windows: tighter first page ---------- */
@media (max-height: 800px) and (min-width: 861px) {
  .run { height: 40px; } .folio { height: 36px; }
  .setup .lede { display: none; }
  .setup .brand { width: 112px; }
  .steps { gap: 5px; }
}

/* ---------- small screens: the two pages stack inside the cover ---------- */
@media (max-width: 860px) {
  :root { --pw: calc(100vw - 52px); --ph: auto; --pad: 24px; }
  .stage { padding: 26px 14px 16px; }
  .book { width: var(--pw); height: auto; display: grid; gap: 10px; perspective: none; }
  .cover { inset: -10px -10px -12px; }
  .cover { background-image: linear-gradient(180deg, rgba(255, 255, 255, .09), transparent 30%, rgba(0, 0, 0, .14)),
                             repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px); }
  .page { position: relative; left: auto !important; height: auto; min-height: 420px; border-radius: 4px !important; box-shadow: 0 2px 0 #e3dbc7, 0 4px 0 #f3eddf, 0 6px 0 #d6ccb6 !important; }
  .page.left, .page.right { background-image: none; }
  .page-body { overflow: visible; }
  .ribbon { display: none; }
  .meta { flex-wrap: wrap; }
  .foot em { flex-basis: 100%; font-size: 19px; }
  .login { min-height: 0; padding-top: 18px; }
  .setup h1 { font-size: 30px; } .login h2 { font-size: 40px; } .letter h2 { font-size: 26px; }
  .login .stamp { width: 110px; }
  .flipper, .cast { display: none; }
  .book.swap .page { animation: fade-in .45s ease both; }
}
/* ---------- phones: Cloudkeep is for the computer the agent runs on ---------- */
@media (max-width: 700px) {
  .book { display: none; }
  .phone-note { display: grid; gap: 16px; justify-items: start; width: min(420px, 100%); padding: 30px 26px 26px; background: var(--paper);
    border-radius: 4px 9px 7px 4px; box-shadow: 0 26px 50px -20px rgba(9, 27, 40, .55), 0 3px 8px rgba(9, 27, 40, .2); transform: rotate(-.6deg); }
  .phone-note .photo { width: 150px; transform: rotate(-2deg); margin-left: -6px; }
  .phone-note h1 { font: 400 34px/1.05 var(--serif); letter-spacing: -.035em; color: #17394e; margin: 0; }
  .phone-note h1 em { font-style: italic; }
  .phone-note p { margin: 0; color: #5b6e75; line-height: 1.65; font-size: 14px; }
  .phone-note .btn { width: 100%; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* terms: may the agent accept a site's terms itself, and the sign-ups it noted */
.terms-ok { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 9px; font-size: 11.5px; color: #6f6550; cursor: pointer; }
.terms-ok input { accent-color: var(--blue); margin: 0; }
.signups { margin-top: 6px; font-size: 11.5px; color: #6f6550; text-align: left; }
.signups summary { cursor: pointer; text-align: center; color: #8c7f62; }
.signups ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; max-height: 120px; overflow: auto; }
.signups a { color: var(--blue); }
