:root{--shell-width:70rem;--edge:clamp(1rem,3vw,2rem)}
body > .max-w-md,body nav.max-w-md{max-width:var(--shell-width)}
body > .max-w-md{min-height:100vh;min-height:100dvh}
body > div > header,main,nav[aria-label]{padding-inline-start:max(var(--edge),env(safe-area-inset-left));padding-inline-end:max(var(--edge),env(safe-area-inset-right))}
body > div > header{padding-top:calc(1.5rem + env(safe-area-inset-top))}
nav[aria-label]{padding-bottom:calc(.5rem + env(safe-area-inset-bottom))}
main.pb-24{padding-bottom:calc(6rem + env(safe-area-inset-bottom))}
main input,main select{min-width:0;font-size:16px}
#panel-scan .w-64{width:min(100%,16rem);height:auto;aspect-ratio:1}
.code-tiles{min-width:0;grid-auto-columns:minmax(0,1fr)}
.code-tiles > span{min-width:0;max-width:100%}
.totp-card,.manage-item,.totp-card header > div:first-child,.manage-item header > div{min-width:0}
.totp-card header p,.manage-item header p,.totp-card h2,.manage-item h2{overflow-wrap:anywhere}
nav a{text-align:center}
.language-setting{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem;border:1px solid #ded8d4;border-radius:20px;background:white}
.language-setting select{padding:.45rem .65rem;border:1px solid #c9bfb6;border-radius:8px;background:white;color:inherit}
@media(max-width:360px){:root{--edge:.75rem}.manage-item footer{flex-wrap:wrap}.totp-card{padding:12px}.code-tiles{gap:2px}}
@media(min-width:700px){
  #totp-list,#manage-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
  #empty-state{grid-column:1/-1}
  main:has(#panel-manual){width:min(100%,42rem);margin-inline:auto}
  main:has(#language){display:grid;grid-template-columns:minmax(14rem,1fr) minmax(0,1.6fr);align-content:start;align-items:start}
  main:has(#language) > .language-setting{grid-column:1}
  main:has(#language) > section:first-of-type{grid-column:1;grid-row:2}
  main:has(#language) > section:nth-of-type(2){grid-column:2;grid-row:1 / span 3}
  main:has(#language) > aside{grid-column:1/-1}
}

/* Shared visual language for the website, examples and native web view. */
:root {
  --ink:#302419;
  --paper:#faf7f2;
  --line:#dcd4c9;
  --accent:#974300;
  --focus:#275ead;
  --radius:18px;
}
body,body>.max-w-md {background:var(--paper);color:var(--ink)}
/* The time dial sits behind the title and scales independently of the touch targets. */
body>.max-w-md>header {
  position:relative;isolation:isolate;overflow:hidden;
  background:linear-gradient(115deg,#ffdaa3 0%,#ffc270 55%,#f59b48);
  padding-block-end:clamp(22px,3.6vw,44px);
  border-bottom:1px solid #cb955a;
}
body>div>header::after {
  content:"";position:absolute;z-index:-1;pointer-events:none;
  width:clamp(180px,38vw,470px);aspect-ratio:1;right:7%;top:50%;
  transform:translate(26%,-45%);border-radius:50%;
  background:repeating-conic-gradient(from -6deg,#8c4a2445 0 .6deg,transparent .6deg 6deg);
  mask-image:radial-gradient(circle,transparent 48%,black 49% 53%,transparent 54% 59%,black 60% 61%,transparent 62%);
}
body>div>header>div {position:relative;z-index:1}
h1 {font-size:clamp(26px,4vw,46px)!important;line-height:1.18!important;letter-spacing:-.04em}
h2,h3 {text-wrap:balance}
main p {line-height:1.65}
main article,.totp-card,.language-setting,main form,#empty-state,main [data-component-type="toggle"] {
  border-color:var(--line);border-radius:var(--radius);
  box-shadow:0 2px 6px #3e251009;
}
.totp-card,.manage-item {background:#fffefa}
.code-tiles {gap:3px}
.code-tiles>span {background:#ffe1af;color:#412607;box-shadow:none;border:1px solid #f1c17d;border-radius:7px}
.code-tiles>span:nth-child(3){margin-inline-end:2px}
.totp-card:active {background:#fff4e4}
nav[aria-label] {background:#fffdf8f7;border-color:var(--line)}
nav a {min-height:46px;justify-content:center;border-radius:12px}
nav a[aria-current="page"] {background:#fff0d9;color:var(--accent);font-weight:650}
main input:not([type=search]), main select {min-height:44px}
.manage-item footer button,[role=tab],dialog button,[data-component-id=button-header-add]{min-height:44px}
.manage-item footer button[aria-label] {min-width:44px}
dialog {color:var(--ink);max-height:calc(100dvh - 2rem);overflow:auto}
dialog::backdrop {background:#2c1c155c}
:where(a,button,input,select,summary,[role=button]):focus-visible {outline:3px solid var(--focus);outline-offset:3px}
#empty-state {border:1px dashed #c4aa87;padding:clamp(24px,5vw,52px) 16px}
#empty-state a {display:inline-flex;align-items:center;justify-content:center;min-height:44px;gap:.4rem;text-underline-offset:4px;text-decoration:underline;margin-inline:8px}
[data-component-id=banner-ad]{isolation:isolate}
[data-component-id=banner-ad] img {height:clamp(86px,14vw,145px)}
[role=tablist] {border:1px solid var(--line)}
[role=tab][aria-selected=true] {color:var(--accent);box-shadow:0 1px 4px #6c3f191c}
details.help-item {background:white;border:1px solid var(--line);border-radius:var(--radius);padding:0 16px}
.help-item summary {min-height:54px;display:flex;align-items:center;gap:10px;list-style:none;cursor:pointer}
.help-item summary::-webkit-details-marker {display:none}
.help-item summary::after {content:"+";margin-inline-start:auto;color:var(--accent);font-size:20px}
.help-item[open] summary::after {content:"−"}
.help-item p {padding:0 0 16px 0}
@media(min-width:900px) {
  body>.max-w-md {border-inline:1px solid var(--line)}
  main {padding-block-start:28px}
  .totp-card,.manage-item {padding:22px}
}
@media(hover:hover) {
  .totp-card:hover, .manage-item button:not(:disabled):hover, nav a:hover {background:#fff4e4}
}
@media(prefers-reduced-motion:no-preference) {
  nav a,.totp-card,button {transition:background-color .15s ease,box-shadow .15s ease}
  dialog[open] {animation:dialog-in .15s ease-out}
  @keyframes dialog-in {from {opacity:0;transform:translateY(5px)}}
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {animation-duration:0s!important;transition-duration:0s!important;scroll-behavior:auto!important}
}
#empty-state a[href="add.html"] {background:var(--accent);color:white;border-radius:12px;padding:0 18px;margin-block:12px 4px;text-decoration:none}
body:has(#panel-manual)>div>header>div {display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px;text-align:center}
body:has(#panel-manual) h1 {font-size:clamp(18px,3.2vw,27px)!important}

/* Account surfaces, empty states and mobile navigation */
body.bg-light-background {background:#eee9e1}
body>div.max-w-md {background:var(--paper)}
.totp-card {border-top:3px solid #bf692c}
.totp-card .code-tiles>span {width:clamp(29px,6vw,46px);font-weight:650;background:#ffebce}
#empty-state:has(.empty-heading) {
  text-align:center;display:flex;align-items:center;flex-direction:column;
  background:radial-gradient(ellipse at 50% 0%,#fff0d8,transparent 65%),#fffdf9;
  border:1px solid var(--line);padding:clamp(26px,4vw,54px) 20px;color:var(--ink);
}
#empty-state .empty-mark {
  display:grid;place-items:center;width:52px;height:52px;margin-bottom:16px;
  background:#36291f;color:#ffdca9;border-radius:18px 18px 18px 6px;font-size:26px;
}
#empty-state .empty-heading {font-size:clamp(20px,2vw,27px);letter-spacing:-.03em}
#empty-state .empty-actions {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;margin-top:14px}
#empty-state .empty-actions a {margin:0 3px}
#empty-state a[href="add.html"] {text-decoration:none;box-shadow:0 3px 9px #883a001a}
#manual-form input:focus {border-color:var(--accent);box-shadow:0 0 0 3px #f1c49466}
#manual-form [aria-invalid=true] {border-color:#a43023}
.field-error {color:#932f23;font-size:14px;line-height:1.55;margin-top:4px}
.totp-card[data-copied] {border-color:#31744f;background:#f3faf3}
.help-item[open] {border-color:#bc9872}
.help-item[open] summary {color:var(--accent)}
nav a[aria-current=page] .material-symbols-outlined {color:#7c3300}
@media (max-width:699px) {
  nav[aria-label] {border-top:1px solid var(--line);box-shadow:0 -5px 20px #33231006}
  main.pb-24 {padding-bottom:calc(6.5rem + env(safe-area-inset-bottom))}
}
@media (min-width:960px) {
  body>.max-w-md {max-width:76rem}
  body>.max-w-md:has(>nav) {display:grid;grid-template-columns:12rem minmax(0,1fr);grid-template-rows:auto 1fr}
  body>.max-w-md:has(>nav)>header {grid-column:1/-1}
  body>.max-w-md:has(>nav)>main {grid-column:2;grid-row:2;min-width:0}
  body>.max-w-md>nav {grid-column:1;grid-row:2;position:sticky;align-self:start;top:1rem;left:auto;bottom:auto;
    transform:none;background:transparent;border:none;padding:20px 10px 20px 16px}
  nav>div.grid {display:flex;flex-direction:column;align-items:stretch;gap:6px}
  nav[aria-label] a.flex {flex-direction:row;justify-content:flex-start;padding:10px;gap:10px;text-align:start}
  nav a[aria-current=page] {background:#ffdfae}
  main:has(#language) {grid-template-columns:minmax(13rem,.9fr) minmax(0,1.3fr)}
}

/* Keep the header action clear of the system indicators on compact native displays. */
@media (max-width:699px) {
  .native-vault header>div:has([data-component-id=button-header-add]) {
    justify-content:flex-start;flex-wrap:wrap;padding-inline-end:44px;column-gap:16px;
  }
}
