@import url("site-family.css");

/* Cloud layout; colors and type are shared with harperurias.com, Espresso, and Switchboard. */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 88% 8%, #e7c9ec75, transparent 36rem), radial-gradient(ellipse at 0 24%, #efc7df45, transparent 42rem), #f5edf7; font: 15px/1.6 var(--font-sans); position: relative; isolation: isolate; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { margin-top: 0; color: var(--ink); font-family: var(--font-display); font-weight: 600; letter-spacing: -.035em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .6rem; }
h2 { font-size: 1.5rem; margin-bottom: .8rem; }
h3 { font-size: 1.15rem; margin-bottom: .6rem; }
p { margin: 0 0 .8rem; }
/* As wide as harperurias.com on laptops, and wider on large screens, so tables and grids use the room. */
.wrap { width: min(1600px, calc(100% - 6rem)); margin-inline: auto; }
@media (max-width: 1100px) { .wrap { width: calc(100% - 4rem); } }
@media (max-width: 800px) { .wrap { width: calc(100% - 3rem); } }
@media (max-width: 520px) { .wrap { width: calc(100% - 2rem); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 100; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link:focus { width: auto; height: auto; overflow: visible; clip-path: none; padding: .7rem 1rem; background: var(--surface); border-radius: 8px; }
:root { --ink: #301b38; --hairline: #815b942b; }
#particles-js { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
#particles-js canvas { display: block; width: 100%; height: 100%; }
.background-toggle { position: fixed; left: 1rem; bottom: 1rem; z-index: 5; border: 1px solid var(--border); border-radius: 999px; background: #fff9fdd9; color: var(--muted); font-size: .68rem; padding: .35rem .75rem; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.eyebrow { display: block; color: var(--accent); font-size: .66rem; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; margin-bottom: .6rem; }
.loading { padding: 4rem 0; color: var(--muted); text-align: center; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 20; color: var(--ink); background: #f5edf7eb; border-bottom: 1px solid var(--hairline); backdrop-filter: blur(18px); }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.brand-monogram { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--deep); font: italic 600 1.7rem/1 var(--font-display); color: #efd6ed; padding-bottom: .2rem; }
.topbar-note { margin-left: auto; color: var(--muted); font-size: .78rem; }
.app-nav { display: flex; gap: .3rem; margin-left: 1rem; }
.app-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .85rem; border-radius: 999px; color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.app-nav a:hover { color: var(--ink); background: #815b9414; }
.app-nav a[aria-current] { color: #fff5fc; background: var(--deep); }
.account { margin-left: auto; }
.account-button { display: inline-flex; align-items: center; gap: .55rem; min-height: 40px; padding: .2rem .7rem .2rem .25rem; border-radius: 999px; list-style: none; font-size: .82rem; color: var(--ink); }
.account-button::-webkit-details-marker { display: none; }
.account-button:hover { background: #815b9414; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg, #7f4d9d, #d46bb2); color: white; font-weight: 700; font-size: .8rem; }
.storage { padding: .5rem .8rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; min-width: 14rem; }
.storage-text { margin: .35rem 0 0; font-size: .75rem; color: var(--muted); }

/* Buttons and fields */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid #7f4d9d40; border-radius: 999px; padding: .55rem 1.05rem; min-height: 40px; font-size: .8rem; font-weight: 600; background: #fff9fdcc; color: var(--accent); white-space: nowrap; list-style: none; transition: box-shadow .2s, transform .2s; }
.button::-webkit-details-marker { display: none; }
.button:hover { box-shadow: 0 4px 18px #7f4d9d1a; transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.button-primary { color: #fff5fc; background: var(--deep); border-color: transparent; box-shadow: 0 5px 15px #301b3814; }
.button-primary:hover { background: #4a2b56; }
.danger-button { color: #a3294f; border-color: #a3294f40; }
.text-button { border: 0; background: none; padding: .4rem .5rem; min-height: 36px; color: var(--accent); font-size: .78rem; font-weight: 600; border-radius: 8px; }
.text-button:hover { background: #7f4d9d12; }
.danger, .text-button.danger { color: #a3294f; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.15rem; line-height: 1; list-style: none; }
.icon-button::-webkit-details-marker { display: none; }
.icon-button:hover { background: #7f4d9d14; color: var(--accent); }
.field { display: grid; gap: .3rem; margin-bottom: .9rem; font-size: .78rem; font-weight: 600; color: #4b2d51; }
.field input, .search input, .copy-row input { width: 100%; min-height: 42px; padding: .55rem .8rem; border: 1px solid #8d5f9966; border-radius: 10px; background: #fffdfe; font-size: .88rem; font-weight: 400; }
.field input:focus, .search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1rem; }
.check { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .9rem; font-size: .82rem; }
.form-error { color: #a3294f; font-size: .8rem; }
.choices { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.choices legend { font-size: .78rem; font-weight: 600; color: #4b2d51; margin-bottom: .4rem; }
.choice { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: #7f4d9d0d; }
.choice span { display: grid; }
.choice strong { font-size: .84rem; }
.choice small { color: var(--muted); font-size: .74rem; }
.choice input { margin-top: .25rem; accent-color: var(--accent); }

/* Cards and panels */
.card, .panel { border: 1px solid var(--border); border-radius: var(--radius); background: #fff9fdd6; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.auth-layout { display: grid; place-items: center; min-height: calc(100vh - 160px); padding: 2rem 0; }
.auth-card { width: min(100%, 26rem); padding: 2rem; display: grid; }
.auth-card .button { margin-top: .4rem; }
.panel { margin: 1.5rem 0; padding: 1.2rem 1.4rem 1.4rem; }
.panel-title { font-size: 1.5rem; margin: 0; }
.panel-note { font-size: .8rem; }
.inline-form { padding: 1.4rem; margin-top: 1.5rem; }
.inline-form .panel-title { margin-bottom: 1rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.search input { width: 13rem; min-height: 40px; border-radius: 999px; padding-inline: 1rem; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; font-family: var(--font-display); font-size: 1.45rem; letter-spacing: -.03em; color: #3c1d40; min-width: 0; }
.crumbs a { color: var(--accent); }
.crumbs a:hover { text-decoration: underline; }
.crumb-separator { color: #b9a3bd; }
.empty { text-align: center; padding: 3.5rem 1rem; border: 2px dashed #8d5f9933; border-radius: 14px; }
.empty-title { font-family: var(--font-display); font-size: 1.3rem; color: #3c1d40; margin-bottom: .3rem; }
.dropping .panel, .dropping .drop-zone { outline: 3px dashed var(--accent); outline-offset: 4px; }

/* Item tables */
.items { width: 100%; border-collapse: collapse; font-size: .84rem; }
.items th { text-align: left; font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.items td { padding: .35rem .6rem; border-bottom: 1px solid #8d5f991f; vertical-align: middle; }
.items tbody tr:hover { background: #7f4d9d08; }
.items .col-size, .items .col-date { color: var(--muted); white-space: nowrap; }
.items .col-actions { width: 1%; text-align: right; white-space: nowrap; }
.item-link { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; border: 0; background: none; padding: 0; text-align: left; font-weight: 500; color: var(--text); max-width: 100%; }
button.item-link:hover .item-name, a.item-link:hover .item-name { color: var(--accent); text-decoration: underline; }
.item-link.static { cursor: default; }
.item-name { overflow-wrap: anywhere; }
.item-meta { display: none; color: var(--muted); font-size: .72rem; }
.item-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; font-size: .52rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: white; background: #9b88a3; }
svg.item-icon { padding: 3px; background: none; fill: #b98ad1; }
.icon-image { background: #c55b9b; }
.icon-video { background: #7f4d9d; }
.icon-audio { background: #4f7fa8; }
.icon-archive { background: #a07a3c; }
.icon-document { background: #5b8a6b; }
.icon-code { background: #3e4b6b; }

/* Menus */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu-list { position: absolute; top: calc(100% + 6px); z-index: 30; min-width: 12rem; padding: .35rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 40px #37153c26; display: grid; text-align: left; }
.menu-right { right: 0; }
.menu-list a { display: flex; align-items: center; padding: .55rem .8rem; border-radius: 8px; font-size: .82rem; min-height: 40px; color: var(--text); }
.menu-list a:hover { background: #7f4d9d12; }
.menu-list button { border: 0; background: none; text-align: left; padding: .55rem .8rem; border-radius: 8px; font-size: .82rem; min-height: 40px; color: var(--text); }
.menu-list button:hover { background: #7f4d9d12; }
.menu-list button.danger { color: #a3294f; }
.account-menu .menu-list { color: var(--text); }

/* Meters, chips, toasts */
.meter { display: block; height: 6px; border-radius: 999px; background: #7f4d9d1f; overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #7f4d9d, #d46bb2); transition: width .2s; }
.chip { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .68rem; font-weight: 600; background: #e9d8f1; color: #6a3f85; white-space: nowrap; }
.chip-active { background: #e1efe3; color: #36603f; }
.chip-revoked, .chip-expired, .chip-limit-reached, .chip-unavailable { background: #f1e3e8; color: #8a3a55; }
.toasts { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 60; display: grid; gap: .5rem; width: min(30rem, calc(100% - 2rem)); }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-radius: 12px; background: #24182d; color: #f8edf9; font-size: .84rem; box-shadow: 0 12px 30px #1a0c2040; }
.toast-error { background: #6e1f3a; }
.toast-action { border: 0; background: none; color: #f2b8de; font-weight: 700; font-size: .8rem; }

/* Uploads */
.uploads { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; width: min(24rem, calc(100% - 2rem)); max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 16px 40px #37153c2e; }
.uploads-head { display: flex; align-items: center; justify-content: space-between; padding: .5rem .5rem .5rem 1rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.uploads ul, .drop-list { list-style: none; margin: 0; padding: .4rem .8rem .6rem; }
.uploads li, .drop-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .2rem .6rem; padding: .45rem 0; font-size: .78rem; }
.upload-name { grid-column: 1 / -1; overflow-wrap: anywhere; }
.uploads .meter, .drop-list .meter { grid-column: 1; }
.upload-status { color: var(--muted); font-size: .72rem; }
.upload-failed { color: #a3294f; }
.drop-zone { display: grid; justify-items: center; gap: .3rem; text-align: center; padding: 3rem 1rem; border: 2px dashed #8d5f9955; border-radius: 14px; }

/* Dialogs */
.dialog { width: min(36rem, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px #1a0c2059; }
.dialog-wide { width: min(56rem, calc(100% - 2rem)); }
.dialog::backdrop { background: #180d1f8c; backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem .5rem 1.4rem; }
.dialog-head h2 { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.dialog-body { padding: .3rem 1.4rem 1.2rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: 0 1.4rem 1.3rem; }
.preview-media { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 10px; }
.preview-text { max-height: 65vh; overflow: auto; padding: 1rem; border-radius: 10px; background: #24182d; color: #f3e5f3; font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.picker { list-style: none; padding: 0; margin: 0; max-height: 45vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.picker li { border-bottom: 1px solid #8d5f991f; }
.picker li.muted { padding: .8rem 1rem; font-size: .82rem; }
.picker button { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: none; padding: .45rem .8rem; text-align: left; min-height: 44px; font-size: .84rem; }
.picker button:hover { background: #7f4d9d0d; }
.picker-path { font-size: .8rem; color: var(--muted); }
.share-list { display: grid; gap: .8rem; margin-bottom: 1.2rem; }
.share-card { padding: .9rem 1rem .5rem; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.share-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.share-label { font-weight: 600; font-size: .84rem; }
.copy-row { display: flex; gap: .5rem; margin-bottom: .4rem; }
.copy-row input { font-size: .78rem; min-width: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: .2rem .4rem; align-items: center; justify-content: flex-end; }
.share-card .row-actions { justify-content: flex-start; margin-left: -.5rem; }
.share-form { padding-top: 1rem; border-top: 1px solid var(--border); }
.share-form .row-actions { justify-content: flex-end; }
.log td { font-size: .78rem; }

/* Thumbnails, grid, and photo viewer */
.item-thumb { object-fit: cover; padding: 0; background: #ece2ef; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid #7f4d9d40; border-radius: 999px; background: #fff9fdcc; }
.segmented button { border: 0; background: none; border-radius: 999px; padding: 0 .8rem; min-height: 32px; font-size: .76rem; font-weight: 600; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: #7f4d9d1a; color: var(--accent); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .9rem; }
.tile { position: relative; display: grid; gap: .15rem; padding: .45rem .45rem .55rem; border: 1px solid #8d5f9926; border-radius: 14px; background: #fffdfe; min-width: 0; }
.tile:hover { border-color: #8d5f9966; }
.tile-open { display: grid; gap: .45rem; border: 0; background: none; padding: 0; text-align: left; color: var(--text); min-width: 0; }
.tile-media { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: #f3ebf5; overflow: hidden; }
.tile-media .item-icon { width: 44px; height: 44px; font-size: .62rem; border-radius: 11px; }
.tile-media .tile-thumb { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.tile-name { font-size: .8rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 1.8rem; }
.tile-meta { font-size: .7rem; color: var(--muted); }
.tile > .menu { position: absolute; right: .25rem; bottom: .3rem; }
.tile > .menu .icon-button { width: 32px; height: 32px; }
.viewer-dialog .dialog-body { padding-bottom: .6rem; }
.viewer { position: relative; display: grid; place-items: center; min-height: 40vh; border-radius: 12px; background: #180d1f; overflow: hidden; touch-action: pan-y; }
.viewer-image { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; }
.viewer-step { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #ffffffd9; color: #3c1d40; font-size: 1.6rem; line-height: 1; box-shadow: 0 4px 16px #0000004d; }
.viewer-previous { left: .6rem; }
.viewer-next { right: .6rem; }
.viewer-caption { margin: .6rem 0 0; font-size: .78rem; color: var(--muted); text-align: center; }

/* Versions */
.version-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; max-height: 55vh; overflow: auto; }
.version { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .2rem 1rem; padding: .35rem .5rem .35rem 1rem; border-bottom: 1px solid #8d5f991f; font-size: .84rem; }
.version:last-child { border-bottom: 0; }
.version.current { background: #7f4d9d0a; }
.version-size { color: var(--muted); white-space: nowrap; }
.version-empty { padding: .8rem 1rem; font-size: .82rem; }
a.text-button { display: inline-flex; align-items: center; }

/* Drives and apps */
.notice { margin: .8rem 0; padding: .75rem 1rem; border-radius: 12px; background: #f6e7d2; color: #6b4513; font-size: .8rem; }
.guides { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; margin-top: 1rem; }
.guide { padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: #fff; font-size: .82rem; }
.guide summary { font-weight: 600; cursor: pointer; }
.guide ol { margin: .6rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; overflow-wrap: anywhere; }

/* Public share pages */
.share-intro { padding: 2rem 0 0; }
.single-file { display: grid; justify-items: center; gap: .8rem; padding: 2.5rem 1.4rem; text-align: center; }
.single-file .item-icon { width: 64px; height: 64px; font-size: .8rem; border-radius: 16px; }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: .2rem .8rem; min-height: 60px; padding: .4rem 0; }
  .app-nav { order: 3; width: 100%; margin: 0 -.85rem; overflow-x: auto; }
  .account-name { display: none; }
  .account-button { padding-right: .25rem; }
  .panel { padding: 1rem; margin: 1rem 0; }
  .crumbs { font-size: 1.2rem; }
  .tools { width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .items thead, .items .col-size, .items .col-date { display: none; }
  .items td { padding-inline: .2rem; }
  .item-link { min-height: 40px; }
  .col-name { display: grid; }
  .item-meta { display: block; margin: -.35rem 0 .3rem 2.9rem; }
  .auth-card { padding: 1.5rem; }
  .dialog-body { padding-inline: 1rem; }
  .dialog-head { padding-left: 1rem; }
  .dialog-actions { padding-inline: 1rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .6rem; }
  .viewer-image { max-height: 60vh; }
  .version { grid-template-columns: 1fr auto; padding-left: .8rem; }
  .version .row-actions { grid-column: 1 / -1; justify-content: flex-start; margin-left: -.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .background-toggle { display: none; }
}

/* Photos timeline */
.photo-months { display: grid; gap: 1.4rem; }
.photo-month-title { font-size: 1.05rem; margin: 0 0 .6rem; }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .35rem; }
.photo-tile { min-width: 0; }
.photo-open { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; background: #f3ebf5; overflow: hidden; }
.photo-open:hover .photo-thumb { scale: 1.03; }
.photo-open .item-icon { position: absolute; inset: 0; margin: auto; }
.photo-thumb { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; transition: scale .2s ease; }
.photo-more { display: block; margin: 1.4rem auto 0; }
@media (max-width: 760px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .2rem; }
  .photo-open { border-radius: 4px; }
}

/* Favorites */
.favorite-mark { color: #c9902a; font-size: .85rem; line-height: 1; flex-shrink: 0; }
.tile-media .favorite-mark { position: absolute; top: .35rem; right: .4rem; z-index: 1; font-size: 1rem; text-shadow: 0 1px 3px #0006; }

/* Sharing with people */
.share-section { font-size: .95rem; margin: 0 0 .6rem; }
.share-section:not(:first-child) { margin-top: 1.3rem; }
.person-list { list-style: none; margin: 0 0 .7rem; padding: 0; display: grid; gap: .35rem; }
.person { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .6rem; padding: .35rem .2rem; border-bottom: 1px solid #8d5f991f; }
.person-name { font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
.shared-mark { flex-shrink: 0; border: 1px solid var(--border); border-radius: 999px; padding: .05rem .45rem; color: var(--muted); font-size: .68rem; font-weight: 500; white-space: nowrap; }
.person select, .person-form select { min-height: 36px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 0 .5rem; font: inherit; font-size: .82rem; }
.person-form { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; }
.person-form input { min-height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 .75rem; font: inherit; }
@media (max-width: 760px) {
  .person { grid-template-columns: auto 1fr auto; }
  .person .text-button { grid-column: 2 / -1; justify-self: start; margin-left: -.5rem; }
  .person-form { grid-template-columns: 1fr auto; }
  .person-form button { grid-column: 1 / -1; }
}

/* Text editor */
.editor-dialog { width: min(60rem, calc(100% - 2rem)); }
.editor-dialog .dialog-body { display: grid; gap: .6rem; }
.editor-tabs { display: flex; gap: .3rem; }
.editor-tabs button { border: 0; border-radius: 999px; padding: .35rem .9rem; background: none; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; }
.editor-tabs button[aria-selected="true"] { background: var(--surface-soft); color: var(--text); }
.editor-text { width: 100%; min-height: min(60vh, 34rem); resize: vertical; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text);
  font: .88rem/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; tab-size: 2; }
.editor-text:focus { outline: 2px solid #7f4d9d66; outline-offset: 1px; }
.editor-status { margin-right: auto; font-size: .78rem; color: var(--muted); }
.markdown { min-height: min(60vh, 34rem); max-height: 70vh; overflow: auto; padding: .4rem 1rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; line-height: 1.6; overflow-wrap: anywhere; }
.markdown h1, .markdown h2, .markdown h3 { margin: 1rem 0 .4rem; }
.markdown h1 { font-size: 1.6rem; }
.markdown h2 { font-size: 1.3rem; }
.markdown h3 { font-size: 1.1rem; }
.markdown h4, .markdown h5, .markdown h6 { font-size: 1rem; margin: .8rem 0 .3rem; }
.markdown p, .markdown ul, .markdown ol, .markdown blockquote, .markdown pre { margin: 0 0 .8rem; }
.markdown code { font: .85em ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--surface-soft); border-radius: 5px; padding: .1em .35em; }
.markdown pre { overflow: auto; padding: .8rem 1rem; border-radius: 10px; background: #1f1426; color: #f4e7f5; }
.markdown pre code { background: none; padding: 0; color: inherit; }
.markdown blockquote { padding-left: .9rem; border-left: 3px solid #d46bb2; color: var(--muted); }
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.markdown .task { list-style: none; margin-left: -1.2rem; }
.markdown a { color: var(--accent); text-decoration: underline; }

/* Two-step sign-in */
.inline-confirm { display: grid; gap: .2rem; max-width: 24rem; margin-top: .6rem; }
.inline-confirm .button { justify-self: start; }
.security-actions { display: grid; gap: .6rem; margin-top: .8rem; }
.setup-steps { display: grid; gap: 1rem; padding-left: 1.2rem; margin: 1rem 0 0; }
.qr { display: block; margin-top: .6rem; border-radius: 10px; image-rendering: pixelated; background: #fff; }
.secret { display: inline-block; margin-top: .3rem; padding: .2rem .5rem; border-radius: 6px; background: var(--surface-soft); font: .9rem ui-monospace, Consolas, monospace; letter-spacing: .04em; word-break: break-all; }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem 1rem; font: .95rem ui-monospace, Consolas, monospace; }

/* Activity and comments */
.nav-badge { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; margin-left: .35rem; padding: 0 .3rem; border-radius: 999px; background: #d46bb2; color: white; font-size: .62rem; font-weight: 700; }
.nav-badge[hidden] { display: none; }
.avatar-small { width: 26px; height: 26px; font-size: .7rem; }
.comment-mark { flex-shrink: 0; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.tile-name .comment-mark { margin-left: .3rem; }
.comments-dialog .dialog-body { display: grid; gap: .8rem; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; max-height: min(50vh, 26rem); overflow-y: auto; }
.comment { padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 12px; background: #fff9fd99; }
.comment-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .82rem; }
.comment-delete { margin-left: auto; min-height: 28px; padding: .2rem .4rem; }
.comment-body { margin: .35rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; }
.comment-empty { font-size: .85rem; }
.comment-input { width: 100%; min-height: 4.5rem; resize: vertical; border: 1px solid var(--border); border-radius: 12px; padding: .6rem .75rem; font: inherit; font-size: .88rem; background: #fff; }
.comment-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.comment-hint { margin-right: auto; }
.activity-list { list-style: none; margin: .4rem 0 0; padding: 0; }
.activity { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .4rem; border-bottom: 1px solid #8d5f991f; }
.activity:last-child { border-bottom: 0; }
.activity-unread { background: linear-gradient(90deg, #d46bb214, transparent 70%); border-radius: 10px; }
.activity-text { min-width: 0; flex: 1; }
.activity-text p { margin: 0; }
.activity-sentence { font-size: .9rem; overflow-wrap: anywhere; }
.activity-item { color: var(--accent); font-weight: 600; }
a.activity-item:hover { text-decoration: underline; }
.activity-item.gone { color: var(--muted); font-weight: 500; }
.activity-names { font-size: .8rem; margin-top: .2rem !important; overflow-wrap: anywhere; }
.activity-comment { margin: .35rem 0 0; padding: .35rem .7rem; border-left: 3px solid #d46bb266; color: var(--text); font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.activity-when { margin-top: .2rem !important; }
@media (max-width: 760px) {
  .app-nav a { padding: 0 .6rem; }
  .comment-hint { display: none; }
}

/* Apps: square tiles in Cloud's colours, as in Cloud Sync's Metro look */
.app-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .9rem; }
.app-tile { display: grid; align-content: end; gap: .2rem; min-height: 10rem; padding: 1rem; border-radius: 14px; color: white; background: #7f4d9d; transition: transform .15s, box-shadow .15s; }
.app-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 26px #37153c26; }
.app-tile:active { transform: scale(.98); }
.app-tile-pink { background: #b8508f; }
.app-tile-plum { background: #7f4d9d; }
.app-tile-blue { background: #4a5fa0; }
.app-tile-ink { background: #2c1b39; }
.app-tile-green { background: #3f7d5c; }
.app-tile-orange { background: #c2532d; }
.app-glyph { font-size: 2rem; line-height: 1; margin-bottom: auto; }
.app-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.app-description { font-size: .74rem; opacity: .85; line-height: 1.35; }

/* Notes: a list of notes beside the open one; on phones, one at a time */
.notes-layout { display: grid; grid-template-columns: minmax(15rem, 20rem) 1fr; gap: 1rem; align-items: start; }
.notes-side { display: grid; gap: .6rem; min-width: 0; }
.notes-notebook { width: 100%; min-height: 40px; padding: .4rem .7rem; border: 1px solid #8d5f9966; border-radius: 10px; background: #fffdfe; font-size: .82rem; }
.notes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: 70vh; overflow: auto; }
.notes-item { display: grid; gap: .1rem; width: 100%; text-align: left; padding: .6rem .75rem; border: 1px solid transparent; border-radius: 12px; background: #fffdfe99; }
.notes-item:hover { border-color: var(--border); }
.notes-item[aria-current="true"] { border-color: #7f4d9d66; background: #f4e7f5; }
.notes-item-title { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-item-snippet { font-size: .78rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notes-item-meta { font-size: .68rem; color: var(--muted); }
.notes-none { padding: .8rem; font-size: .82rem; }
.notes-editor { display: grid; gap: .6rem; min-width: 0; }
.notes-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.notes-title { margin: 0; font-size: 1.35rem; flex: 1 1 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-actions { display: flex; align-items: center; gap: .4rem; flex: 1 1 100%; }
.notes-actions .editor-status { margin-right: auto; }
.notes-back { display: none; }
.notes-text, .notes-preview { min-height: min(62vh, 36rem); }
.notes-preview { max-height: none; }
.notes-empty { padding: 5rem 1rem; }
.notes-foot { margin: 1rem 0 0; }
.notes-conflict .row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.task-toggle { border: 0; background: none; padding: 0 .1rem; font: inherit; font-size: 1.05em; color: var(--accent); cursor: pointer; }
.task-done { color: var(--muted); }
@media (max-width: 760px) {
  .notes-layout { grid-template-columns: 1fr; }
  .notes-layout[data-pane="list"] .notes-editor, .notes-layout[data-pane="editor"] .notes-side { display: none; }
  .notes-back { display: inline-flex; }
  .notes-list { max-height: none; }
  .app-tiles { grid-template-columns: repeat(2, 1fr); }
  .app-tile { min-height: 8.5rem; }
}

/* Home: a dashboard of widgets in three columns; wide widgets take two */
.dashboard { margin: 1.5rem 0 3rem; }
.dashboard-head { align-items: flex-end; }
.dashboard-title { margin: 0; }
.widget-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.widget { min-width: 0; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff9fdd6; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.widget-wide { grid-column: span 2; }
.widget-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; }
.widget-head h2 { margin: 0 auto 0 0; font-size: 1.1rem; }
.widget-controls { display: flex; align-items: center; gap: .1rem; }
.widget-grid-editing .widget { cursor: grab; border-style: dashed; }
.widget-grid-editing .widget-body { opacity: .55; pointer-events: none; }
.widget-dragging { opacity: .4; }
.widget-target { outline: 2px dashed var(--accent); outline-offset: 3px; }
.widget-none { grid-column: 1 / -1; }
.widget-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.widget-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; padding: .35rem .4rem; border-radius: 10px; }
.widget-item:hover, .widget-note:hover { background: #7f4d9d0f; }
.widget-item .item-icon { width: 28px; height: 28px; }
.widget-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; font-weight: 500; }
.widget-item-meta { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-note { display: grid; gap: .05rem; padding: .4rem .5rem; border-radius: 10px; }
.widget-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); gap: .4rem; }
.widget-photos a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-soft); }
.widget-photos .widget-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.widget-activity { margin: 0; }
.widget-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.widget-choice { display: grid; gap: .1rem; width: 100%; text-align: left; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: #fffdfe; }
.widget-choice:hover { border-color: #7f4d9d66; }
.widget-frame { width: 100%; min-height: 9rem; border: 0; border-radius: 10px; background: transparent; display: block; }
@media (max-width: 960px) { .widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .widget-grid { grid-template-columns: 1fr; } .widget-wide { grid-column: auto; } }

/* GitHub */
.github-login { font-family: var(--font-sans); font-size: 1rem; font-weight: 500; letter-spacing: 0; }
.github-connect { max-width: 36rem; }
.github-steps { padding-left: 1.2rem; margin: 0 0 1rem; font-size: .88rem; }
.github-steps a, .github-item a { color: var(--accent); font-weight: 600; }
.github-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; }
.github-section { margin-bottom: 1.2rem; min-width: 0; }
.github-heading { font-size: 1.05rem; margin-bottom: .4rem; }
.github-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.github-item { display: grid; gap: .1rem; padding: .5rem .2rem; border-bottom: 1px solid #8d5f991f; min-width: 0; }
.github-item:last-child { border-bottom: 0; }
.github-title { font-size: .86rem; font-weight: 500; overflow-wrap: anywhere; }
.github-title .chip { margin-left: .3rem; vertical-align: 1px; }
.github-title .chip:first-child { margin-left: 0; }
.github-meta { font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.github-labels { display: flex; gap: .25rem; flex-wrap: wrap; }
.github-item .row-actions { display: flex; gap: .2rem; flex-wrap: wrap; justify-content: flex-start; margin-left: -.5rem; }
.github-add input { min-height: 40px; padding: .4rem .9rem; border: 1px solid #8d5f9966; border-radius: 999px; background: #fffdfe; width: 13rem; }
.widget-sub { font-family: var(--font-sans); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: .3rem 0 .1rem; }
@media (max-width: 760px) { .github-columns { grid-template-columns: 1fr; } .github-add input { width: 100%; } }
.github-add { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* Plugins: an installed app's page is a sandboxed frame */
.app-page { display: grid; }
.app-version { font-family: var(--font-sans); font-size: .9rem; font-weight: 500; letter-spacing: 0; }
.app-frame { width: 100%; height: max(28rem, calc(100vh - 15rem)); border: 1px solid var(--border); border-radius: 12px; background: #fffdfe; }
.app-permissions { margin: 0 0 1rem; padding-left: 1.2rem; }
.app-summary { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .8rem; }
.app-summary p { margin: .2rem 0 0; }
.app-glyph-small { display: grid; place-items: center; flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 10px; color: white; font-size: 1.3rem; }

/* Calendar: calendars beside a month grid; on phones, a list of the month under a smaller grid */
.calendar-layout { display: grid; grid-template-columns: 12rem 1fr; gap: 1.2rem; align-items: start; }
.calendar-side-title { font-size: 1rem; margin-bottom: .4rem; }
.calendar-list { list-style: none; margin: 0 0 .4rem; padding: 0; display: grid; gap: .1rem; }
.calendar-list li { display: flex; align-items: center; justify-content: space-between; }
.calendar-toggle { display: flex; align-items: center; gap: .45rem; font-size: .84rem; cursor: pointer; min-width: 0; min-height: 36px; }
.calendar-toggle input { accent-color: var(--accent); }
.calendar-dot { width: .75rem; height: .75rem; border-radius: 50%; flex-shrink: 0; }
.calendar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-main { min-width: 0; }
.calendar-nav { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; }
.calendar-month { margin: 0 0 0 .5rem; font-size: 1.35rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fffdfe; }
.calendar-weekday { padding: .35rem .5rem; font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.calendar-day { min-height: 6.4rem; padding: .25rem .3rem .35rem; border-right: 1px solid #8d5f991f; border-bottom: 1px solid #8d5f991f; display: grid; align-content: start; gap: .15rem; cursor: pointer; min-width: 0; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover { background: #7f4d9d08; }
.calendar-other { background: #f7eef8; color: var(--muted); }
.calendar-date { font-size: .78rem; font-weight: 600; justify-self: start; padding: .05rem .4rem; border-radius: 999px; }
.calendar-today .calendar-date { background: var(--accent); color: white; }
.calendar-event { --event: #7f4d9d; display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--event); border-radius: 5px; padding: .1rem .35rem; font-size: .72rem;
  background: color-mix(in srgb, var(--event) 12%, white); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.calendar-allday { background: var(--event); color: white; }
.calendar-event:hover { filter: brightness(.96); }
.calendar-more { border: 0; background: none; color: var(--accent); font-size: .7rem; font-weight: 600; text-align: left; padding: 0 .3rem; cursor: pointer; }
.calendar-where, .calendar-repeat { opacity: .75; }
.calendar-agenda { display: none; list-style: none; margin: 1rem 0 0; padding: 0; }
.calendar-agenda-day h3 { font-family: var(--font-sans); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: .9rem 0 .3rem; }
.calendar-agenda ul, .calendar-day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.calendar-agenda .calendar-event, .calendar-day-list .calendar-event { font-size: .86rem; padding: .45rem .6rem; white-space: normal; }
.calendar-dialog { width: min(34rem, calc(100% - 2rem)); }
.calendar-dialog textarea { width: 100%; padding: .55rem .8rem; border: 1px solid #8d5f9966; border-radius: 10px; font: inherit; font-size: .88rem; resize: vertical; }
.calendar-dialog select { width: 100%; min-height: 42px; padding: .4rem .7rem; border: 1px solid #8d5f9966; border-radius: 10px; background: #fffdfe; font-size: .88rem; }
.calendar-when { display: flex; gap: .4rem; }
.calendar-when input { min-height: 42px; padding: .4rem .6rem; border: 1px solid #8d5f9966; border-radius: 10px; font: inherit; font-size: .86rem; flex: 1; min-width: 0; }
.calendar-allday-check { align-self: end; margin-bottom: 1.4rem; }
.calendar-swatches { display: flex; gap: .5rem; }
.calendar-swatch { width: 2rem; height: 2rem; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.calendar-swatch[aria-checked="true"] { border-color: white; box-shadow: 0 0 0 2px var(--text); }
.calendar-connect { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0 0 1rem; }
.calendar-connect dt { font-weight: 600; font-size: .82rem; }
.calendar-connect dd { margin: 0; overflow-wrap: anywhere; }
.upcoming-item { --event: #7f4d9d; border-left: 3px solid var(--event); border-radius: 0 10px 10px 0; }
@media (max-width: 760px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-side { order: 2; }
  .calendar-day { min-height: 3rem; }
  .calendar-day .calendar-event, .calendar-more { display: none; }
  .calendar-day:has(.calendar-event)::after { content: ""; width: .35rem; height: .35rem; border-radius: 50%; background: var(--accent); justify-self: center; }
  .calendar-agenda { display: block; }
  .calendar-when { flex-wrap: wrap; }
}

/* Contacts reuse the Notes layout */
.contacts-item { grid-template-columns: auto 1fr; align-items: center; gap: .6rem; }
.contacts-item-text { display: grid; min-width: 0; }
.contacts-card-head { display: flex; align-items: center; gap: .9rem; flex: 1 1 100%; min-width: 0; }
.contacts-card-head p { margin: 0; }
.contacts-avatar { width: 3.2rem; height: 3.2rem; font-size: 1.1rem; }
.contacts-fields { display: grid; gap: .1rem; margin: .4rem 0 0; }
.contacts-row { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .55rem .2rem; border-bottom: 1px solid #8d5f991f; }
.contacts-row dt { color: var(--muted); font-size: .82rem; }
.contacts-row dd { margin: 0; overflow-wrap: anywhere; }
.contacts-row a { color: var(--accent); font-weight: 600; }
.contacts-notes { white-space: pre-wrap; }
.contacts-entries { display: grid; gap: .4rem; }
.contacts-entry { display: grid; grid-template-columns: 7rem 1fr auto; gap: .4rem; align-items: center; }
.contacts-entry input, .contacts-entry select { min-height: 40px; padding: .4rem .7rem; border: 1px solid #8d5f9966; border-radius: 10px; background: #fffdfe; font: inherit; font-size: .86rem; min-width: 0; }
.contacts-entries .text-button { justify-self: start; }

/* Groups, on the People page */
.group-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.group { padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #fffdfe; }
.group-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.group-head strong { margin-right: auto; }
.group-members { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.group-member { display: inline-flex; align-items: center; gap: .2rem; font-size: .74rem; padding: .2rem .3rem .2rem .65rem; }
.chip-remove { border: 0; background: none; color: inherit; font-size: .9rem; line-height: 1; padding: 0 .25rem; cursor: pointer; border-radius: 999px; }
.chip-remove:hover { background: #7f4d9d22; }
.group-add { display: inline-flex; gap: .2rem; align-items: center; }
.group-add select { min-height: 32px; padding: .2rem .5rem; border: 1px dashed #8d5f9966; border-radius: 999px; background: none; font-size: .76rem; color: var(--muted); }
.calendar-side-shared { margin-top: 1.2rem; }

/* Passkeys */
.auth-or { display: flex; align-items: center; gap: .8rem; margin: 1rem 0 .8rem; color: var(--muted); font-size: .75rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.passkey-button { width: 100%; }
.passkey-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }
.passkey { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: #fffdfe; }
.passkey p { margin: .1rem 0 0; }

/* Health */
.health-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.health-tile { display: grid; gap: .15rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.health-tile-label { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.health-tile-value { font: 600 1.7rem/1.2 var(--font-display); color: #3c1d40; letter-spacing: -.03em; }
.health-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: .8rem; }
.chart-card { padding: .9rem 1rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); min-width: 0; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.chart-title { font-size: 1.05rem; margin: 0 0 .2rem; }
.chart { position: relative; min-height: 190px; }
.chart-svg { display: block; overflow: visible; touch-action: pan-y; }
.chart-svg:focus-visible { outline-offset: 2px; border-radius: 6px; }
.chart-pickable { cursor: pointer; }
.chart-grid { stroke: #8d5f9926; stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-cursor { stroke: #8d5f9959; stroke-width: 1; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { stroke: var(--surface); stroke-width: 2; }
.chart-mark { transition: opacity .12s; }
.chart-svg:hover .chart-mark:not(.is-active), .chart-svg:focus-visible .chart-mark:not(.is-active) { opacity: .55; }
.hc-activity { fill: #7f4d9d; }
.hc-activity.chart-line { stroke: #7f4d9d; fill: none; }
.hc-sleep { fill: #3f6fb0; }
.hc-heart, .hc-heart .chart-range, .hc-heart .chart-dot { fill: #c2489b; }
.hc-heart .chart-range { fill-opacity: .45; }
.hc-heart.chart-line { stroke: #c2489b; fill: none; }
.chart-tooltip { position: absolute; top: -.4rem; display: grid; gap: .05rem; padding: .4rem .65rem; border-radius: 10px; background: var(--deep); color: #fff6fb; font-size: .74rem; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.chart-none { padding: 2rem 0; text-align: center; }
.health-detail:not(:empty) { margin-top: .8rem; }
.health-table { margin-top: 1rem; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.data-table thead th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.health-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin-top: 1rem; }
.health-footer span { margin-right: auto; }
.health-empty { max-width: 42rem; }
.health-empty ol { padding-left: 1.2rem; }
.health-widget { display: grid; gap: .5rem; margin: 0; }
.health-widget div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .35rem; }
.health-widget dt { color: var(--muted); font-size: .8rem; }
.health-widget dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Signing in a device by a code */
.device-card { max-width: 30rem; display: grid; gap: .6rem; }
.device-code-input { font: 600 1.4rem/1.2 ui-monospace, "Cascadia Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.device-name { font-size: 1.05rem; }
.device-card, .health-empty { padding: 1.2rem 1.3rem; }

/* Lab results */
.lab-section { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.lab-head { flex-wrap: wrap; margin-bottom: .3rem; }
.lab-head .panel-title { margin: 0; }
.lab-tests { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .7rem; }
.lab-test { width: 100%; display: grid; gap: .2rem; text-align: left; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); }
.lab-test:hover { border-color: #7f4d9d80; }
.lab-test-name { font-weight: 600; font-size: .85rem; }
.lab-test-value strong { font: 600 1.45rem/1.2 var(--font-display); color: #3c1d40; }
.lab-test-value { color: var(--muted); font-size: .8rem; }
.lab-status { font-size: .74rem; font-weight: 600; }
.lab-status-in { color: #2f6b4b; }
.lab-status-high, .lab-status-low { color: #a8431f; }
.lab-status-none { color: var(--muted); font-weight: 500; }
.lab-trend { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: center; }
.lab-verdict { padding: 0 .45rem; border-radius: 999px; font-size: .68rem; font-weight: 700; line-height: 1.6; }
.lab-verdict-better { background: #3f7d5c1f; color: #2f6b4b; }
.lab-verdict-worse { background: #c2532d1f; color: #a8431f; }
.lab-verdict-steady { background: #7f4d9d14; color: var(--accent); }
.lab-spark { height: 48px; margin-top: .3rem; }
.lab-band { fill: #3f7d5c26; }
.lab-line { stroke: #7f4d9d; }
.lab-dot { fill: #7f4d9d; }
.lab-dot-high, .lab-dot-low { fill: #c2532d; }
.lab-dot.is-active { r: 7px; }
.lab-detail:not(:empty) { margin-top: .8rem; }
.lab-detail .table-scroll { margin-top: .8rem; }
.lab-reports-title { margin: 1.4rem 0 .5rem; font-size: 1.05rem; }
.lab-reports { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.lab-report { margin: 0; }
.lab-report .row-actions { margin-top: .5rem; }
.lab-notes { margin: .6rem 0 0; white-space: pre-wrap; font-size: .82rem; }
.lab-empty { max-width: 42rem; padding: 1.1rem 1.3rem; }
.lab-form { display: grid; gap: .7rem; }
.lab-form textarea { width: 100%; font: inherit; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); resize: vertical; }
.lab-entry td { padding: .25rem .25rem; }
.lab-entry input { width: 100%; min-width: 4.5rem; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.lab-entry td:first-child input { min-width: 10rem; }
.lab-add { align-items: center; flex-wrap: wrap; }
.lab-template { padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .78rem; color: var(--accent); font-weight: 600; }

/* More Home widgets */
.widget-apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .5rem; }
.widget-app { display: grid; align-content: end; gap: .1rem; min-height: 4.8rem; padding: .55rem .6rem; border-radius: 12px; color: white; }
.widget-app:hover { filter: brightness(1.08); }
.widget-app-glyph { font-size: 1.2rem; line-height: 1; }
.widget-app-name { font-size: .74rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-figure { margin: 0 0 .4rem; color: var(--muted); font-size: .82rem; }
.widget-figure strong { font: 600 1.5rem/1 var(--font-display); color: #3c1d40; margin-right: .1rem; }
.import-steps { padding-left: 1.2rem; margin-top: 0; }
.lab-profiles { display: grid; gap: .4rem; }
.lab-profile { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.lab-profile:has(input:checked) { border-color: var(--accent); background: #7f4d9d0d; }
.lab-profile input { margin-top: .25rem; accent-color: var(--accent); }
.lab-profile > span { display: grid; gap: .1rem; }
.lab-ranges-heading { font-size: 1rem; margin: 1rem 0 .4rem; }
.backups-panel .backup-ok { color: #2f6b4b; font-weight: 600; }
.backup-list { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .82rem; }
/* A card never grows past its column: its chart is drawn to fit it. */
.lab-tests > li { min-width: 0; }
.lab-test { min-width: 0; overflow: hidden; }
.lab-spark { min-width: 0; overflow: hidden; }
.lab-spark .chart-svg { max-width: 100%; }

/* Medications */
.meds-heading { font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
.meds-due, .meds-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.med-due { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.med-due.is-overdue { border-color: #c2532d80; background: #c2532d0a; }
.med { display: grid; gap: .3rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.med-main { display: grid; gap: .15rem; }
.med-main .chip { margin-left: .5rem; }
.med-notes { white-space: pre-wrap; }
/* Inventory: a low supply stands out, and counts line up with their unit. */
.med-low { color: #c2532d; font-weight: 600; }
.count-cell { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.count-input { width: 6.5rem; }
.meds-list-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.meds-category { max-width: 16rem; }
.meds-empty { max-width: 42rem; padding: 1.1rem 1.3rem; }
.widget-med { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.widget-med > span { display: grid; min-width: 0; }
.widget-item-meta.is-overdue { color: #a8431f; font-weight: 600; }
.lab-mark line { stroke: #2c1b39; stroke-opacity: .35; stroke-width: 1; }
.lab-mark text { fill: var(--muted); font-size: 10px; }
.print-only { display: none; }
@media print {
  .topbar, .no-print, .background-toggle, #particles-js, .toasts { display: none !important; }
  .print-only { display: block; }
  body { background: white; }
  .panel { box-shadow: none; border: 0; backdrop-filter: none; }
}
/* Medication summary: adherence rings and calendar */
.summary-period { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; margin-bottom: 1rem; }
.summary-title { margin-bottom: .2rem; }
.adherence-rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.adherence-card { display: grid; justify-items: center; gap: .2rem; padding: .9rem .6rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: center; }
.adherence-card.is-overall { grid-column: span 2; }
.ring-wrap { position: relative; display: grid; place-items: center; }
.ring-percent { position: absolute; font: 600 1.25rem/1 var(--font-display); color: #3c1d40; }
.is-overall .ring-percent { font-size: 1.7rem; }
.ring-track { stroke: #8d5f9926; }
.ring-good .ring-fill { stroke: #3f7d5c; }
.ring-fair .ring-fill { stroke: #c08a2d; }
.ring-low .ring-fill { stroke: #c2532d; }
.adherence-calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cal-month h4 { margin: 0 0 .4rem; font-size: .95rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-head { font-size: .68rem; color: var(--muted); font-weight: 600; padding-bottom: .2rem; }
.cal-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; font-size: .7rem; }
.cal-day .ring { position: absolute; width: 82%; height: 82%; }
.cal-day.is-outside, .cal-day.is-future { color: #8d5f9966; }
.cal-day.is-today .cal-number { font-weight: 700; color: var(--accent); }
.cal-number { position: relative; }
.cal-legend { grid-column: 1 / -1; margin: 0; }
@media print { .adherence-card, .cal-day .ring { break-inside: avoid; } }

/* Medications: filters, today's doses by part of the day, lookup, and time slots */
.meds-list-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.4rem; }
.meds-list-head .meds-heading { margin: 0; }
.meds-search input { min-width: min(22rem, 100%); }
.meds-chips { flex-wrap: wrap; margin: .7rem 0 .4rem; border-radius: 22px; }
.chip.kind-otc { background: #e1efe3; color: #36603f; }
.chip.kind-supplement { background: #f4ead8; color: #7a5520; }
.med-main strong .chip { margin-left: .45rem; vertical-align: middle; }
.meds-today { margin-top: .6rem; }
.today-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .9rem; margin-top: .6rem; }
.today-group { border: 1px solid var(--border); border-radius: var(--radius); background: #fffafdcc; padding: .8rem .9rem .5rem; }
.today-group h3 { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-family: var(--font-sans); margin-bottom: .4rem; }
.today-group ul { list-style: none; margin: 0; padding: 0; }
.today-item { display: grid; grid-template-columns: 3.4rem 1fr auto; align-items: center; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--border); }
.today-item:first-child { border-top: 0; }
.today-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.today-name { display: grid; line-height: 1.3; min-width: 0; }
.today-name strong { overflow-wrap: anywhere; }
.today-item.is-taken .today-name strong { color: var(--muted); }
.today-item.is-late .today-time { color: #a2475f; }
.today-done { color: #36603f; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.today-take { min-height: 34px; padding: .3rem .85rem; }
.dialog.dialog-wide { width: min(46rem, calc(100vw - 2rem)); }
.lookup-wrap { position: relative; }
.lookup-results { list-style: none; margin: .2rem 0 0; padding: .3rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface, #fffafd); box-shadow: var(--shadow); max-height: 18rem; overflow-y: auto; }
.lookup-item { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; gap: .1rem .5rem; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .6rem; border-radius: 10px; }
.lookup-item:hover, .lookup-item:focus-visible { background: #7f4d9d14; }
.lookup-item .muted { grid-column: 1 / -1; }
.lookup-note { padding: .45rem .6rem; }
.lookup-info { border: 1px solid var(--border); border-radius: 14px; padding: .7rem .9rem; background: #f8f0f9; }
.lookup-info dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .3rem 1rem; margin: .4rem 0; }
.lookup-info dt { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.lookup-info dd { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
.slot-block { display: grid; gap: .4rem; margin: .4rem 0; }
.field-label { font-size: .8rem; font-weight: 600; }
.slot-rows { display: grid; gap: .35rem; }
.slot-row { display: grid; grid-template-columns: 8.5rem 7.5rem 6rem auto 2rem; align-items: center; gap: .5rem; padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 14px; opacity: .65; }
.slot-row.is-on { opacity: 1; background: #7f4d9d0d; border-color: #7f4d9d40; }
.slot-name { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .85rem; }
.slot-row input:not([type=checkbox]) { width: 100%; min-height: 38px; padding: .4rem .6rem; border: 1px solid #8d5f9966; border-radius: 10px; background: #fffdfe; font-size: .88rem; }
.usage-table td { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .slot-row { grid-template-columns: 1fr 1fr; }
  .slot-name { grid-column: 1 / -1; }
  .today-item { grid-template-columns: 3rem 1fr; }
  .today-item > :last-child { grid-column: 2; justify-self: start; }
}
.field select, .field textarea { width: 100%; min-height: 42px; padding: .45rem .7rem; border: 1px solid #8d5f9966; border-radius: 10px; background: #fffdfe; font: inherit; font-size: .88rem; }
.lookup-item .chip { justify-self: start; }
@media (min-width: 900px) { .meds-search input { min-width: 26rem; } }
