:root {
  touch-action: pan-x pan-y;
  color-scheme: light;
  --ink: #242b25;
  --muted: #657067;
  --rule: #dedfd6;
  --green: #375c47;
  --paper: #faf9f5;
  --card: #fff;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #eaece6;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, .top-action { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, select, input, textarea {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
button, .top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 9px 14px;
  font-size: .9rem;
  font-weight: 620;
  line-height: 1.35;
  cursor: pointer;
}
button:active, .top-action:active { opacity: .75; }
button:disabled { cursor: progress; opacity: .6; }
:is(button,input,select,textarea,a):focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.primary { color: #fff; background: var(--green); border-color: var(--green); }
.topbar {
  padding: calc(env(safe-area-inset-top,0px) + 6px) max(12px,env(safe-area-inset-right,0px)) 6px max(16px,env(safe-area-inset-left,0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 5px;
  min-height: 58px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.brand, .topbar nav { display: flex; align-items: center; }
.brand { gap: 7px; letter-spacing: -.035em; }
.brand img { border-radius: 9px; }
.top-action, .back { border: 0; background: transparent; color: var(--green); text-decoration: none; }
.top-action { padding-inline: 8px; font-size: .84rem; }
@media (display-mode:standalone) { .install-link { display: none; } }
html[data-standalone] .install-link { display: none; }
main {
  padding: 22px max(16px,env(safe-area-inset-right,0px)) calc(28px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));
}
h1 { margin: 0; font-size: 1.65rem; font-weight: 760; letter-spacing: -.045em; line-height: 1.3; }
.heading, .list-caption, .filter-options, .account-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.heading { margin: 0 0 18px; }
.add-account span { font-size: 1.12em; font-weight: 450; margin-right: 4px; }
.panel, .filter-panel, #account-list li, #empty {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 17px;
}
.panel { padding: 20px 16px; }
.compact { margin: 16px 0 0; }
.panel h1 { margin-bottom: 12px; }
.filter-panel { display: grid; gap: 5px; padding: 10px 12px 4px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #f4f5ef;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
}
.search-field:focus-within { border-color: var(--green); }
.search-field svg { flex: 0 0 auto; }
.search-field input { background: transparent; border: 0; padding-inline: 0; }
.search-field input:focus-visible { outline: none; }
.filter { position: relative; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.filter select, #refresh { padding-inline: 5px; color: var(--green); background: transparent; border: 0; }
.filter select { -webkit-appearance: none; appearance: none; min-height: 46px; padding-right: 24px; }
.filter::after {
  content: ''; position: absolute; top: 50%; right: 8px; width: 6px; height: 6px;
  border-right: 1.5px solid var(--green); border-bottom: 1.5px solid var(--green);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.list-caption { margin: 18px 2px 8px; }
.list-caption, .muted, #empty { color: var(--muted); font-size: .83rem; }
.notice:empty { display: none; }
.notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #e7f0de; }
.notice[data-error=true] { background: #fbeae3; color: #903b2d; }
ul { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
#account-list li { display: grid; gap: 14px; min-width: 0; padding: 15px; }
.account-heading { align-items: flex-start; }
.account-identity { min-width: 0; }
.account-identity strong, .account-identity small { display: block; }
.account-identity strong { font-size: 1.03rem; line-height: 1.4; }
.account-identity small { color: var(--muted); font-size: .83rem; }
.status { flex: 0 0 auto; border-radius: 999px; padding: 3px 9px; font-size: .76rem; color: #446148; background: #e7f0de; }
.status[data-state=expired] { color: #865246; background: #f4e6df; }
.status[data-state=pending] { color: #755e23; background: #fff0bb; }
.expiry { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); font-size: .84rem; }
.expiry time { color: var(--ink); font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.actions button { color: var(--green); }
.actions button:last-child { background: #edf3e9; border-color: #d7e3d5; }
#empty { margin: 0; padding: 22px 14px; text-align: center; }
.back { padding-left: 0; gap: 4px; margin: -11px 0 8px; }
.back span { font-size: 1.5em; font-weight: 400; }
form, #credentials { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
form { margin-top: 18px; }
form .primary, #copy-info, #retry { width: 100%; min-height: 48px; }
label, legend { font-size: .89rem; font-weight: 620; }
label { display: grid; gap: 6px; }
input, select, textarea { min-height: 46px; padding: 10px; font-size: max(16px,1rem); font-weight: 400; }
input, textarea { width: 100%; }
input[readonly], textarea[readonly] { background: #f5f6f0; }
input[type=datetime-local] { font-variant-numeric: tabular-nums; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
fieldset div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin-top: 6px; }
fieldset button { flex-direction: column; gap: 3px; min-height: 55px; min-width: 0; padding: 6px 0; }
fieldset button[aria-pressed=true] { border-color: var(--green); background: #edf3e9; color: var(--green); }
fieldset small { display: block; font-size: .75rem; font-weight: 450; }
textarea { margin: 6px 0 14px; resize: vertical; }
