:root {
  color-scheme: light;
  --green: #1e694b;
  --ink: #203a31;
  --muted: #52695d;
  --line: #d7e2d7;
  font: 16px/1.5 "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: #f8f9f5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(1120px, calc(100% - 8vw)); margin: auto; }
header { background: white; border-bottom: 1px solid var(--line); }
.bar, .brand, .identity, .section-top, .dialog-actions { display: flex; align-items: center; gap: .75rem; }
.bar { min-height: 72px; justify-content: space-between; padding-block: .6rem; }
.brand { gap: .55rem; font-size: 1.4rem; font-weight: 750; color: #174f37; letter-spacing: -.05em; }
.logo { padding: 3px; border-radius: 11px; color: white; background: var(--green); flex: 0 0 auto; }
.product { color: var(--muted); font-size: .88rem; font-weight: 550; letter-spacing: 0; border-left: 1px solid var(--line); margin-left: .3rem; padding-left: .8rem; }
.identity { font-size: .9rem; overflow-wrap: anywhere; min-width: 0; }
main { padding-block: clamp(1.5rem, 4vw, 3.5rem); }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.15; color: #183e2d; letter-spacing: -.045em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1.5rem; }
h2 { font-size: 1.35rem; margin-bottom: 1.25rem; }
.layout { display: grid; grid-template-columns: minmax(17rem, .78fr) minmax(0, 1.5fr); gap: 1.25rem; align-items: start; }
.card, dialog { border: 1px solid var(--line); background: white; border-radius: 18px; padding: clamp(1.15rem, 2.8vw, 2rem); }
.auth { max-width: 28rem; margin: min(6vh, 3rem) auto; }
.auth h1 { font-size: 2rem; }
form, #issue-result { display: grid; gap: 1rem; }
input, select, button { font: inherit; }
label, legend { font-weight: 650; font-size: .93rem; }
label > input:not([type="radio"],[type="checkbox"]), label > select {
  display: block; width: 100%; padding: .6rem .75rem; min-height: 44px; margin-top: .3rem;
  border: 1px solid #aebfb3; background: white; color: var(--ink); border-radius: 8px; font-size: 1rem; font-weight: 400;
}
input[type="radio"], input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--green); flex: none; margin: 0; }
input::placeholder { color: #5b7065; opacity: 1; }
input:read-only { background: #f5f8f3 !important; }
button {
  min-height: 42px; cursor: pointer; border: 1px solid #acbfb0;
  border-radius: 8px; background: white; color: #185438; font-size: .93rem; font-weight: 650; padding: .5rem .85rem;
}
button:hover { background: #edf4ed; }
button:disabled { opacity: .6; cursor: wait; }
button.primary { background: var(--green); color: white; border-color: var(--green); }
button.primary:hover { background: #17533b; }
button.danger { background: #913827; color: white; border-color: #913827; }
button.quiet { font-size: .85rem; }
button.link { justify-self: start; min-height: 36px; border: 0; padding: .25rem 0; color: var(--green); text-decoration: underline; background: transparent; }
button#back-login { margin-top: .75rem; }
:is(button, input, select, li):focus-visible { outline: 3px solid #c68126; outline-offset: 3px; }
h1:focus, h2:focus { outline: none; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .45rem; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.choices label, .store-list label { display: flex; align-items: center; gap: .55rem; cursor: pointer; min-height: 42px; }
.choices label { border: 1px solid #aebfb3; border-radius: 8px; padding: .5rem .6rem; }
.choices label:has(input:checked) { background: #e8f2e6; border-color: var(--green); }
.store-list { display: grid; }
.store-list label { font-weight: 500; border-bottom: 1px solid var(--line); }
.optional, small, .hint, #list-state, .meta { color: var(--muted); font-weight: 400; }
.hint, small, .meta { font-size: .87rem; }
#password-hint { margin-top: -.8rem; }
.section-top { justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-top h2 { margin: 0; }
.toolbar { display: grid; gap: .85rem; grid-template-columns: auto minmax(0,1fr); align-items: end; }
.lookup { display: flex; align-items: end; gap: .45rem; }
.lookup label { flex: 1; min-width: 0; }
#list-state { font-size: .9rem; margin-top: 1rem; }
#invite-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.invite { display: flex; align-items: center; gap: .75rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.invite-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.invite strong { display: block; }
.invite p { margin-top: .15rem; }
.invite button { flex-shrink: 0; }
.found { background: #eef5eb; border-left: 3px solid var(--green); padding-left: .7rem; }
.mono { font-family: ui-monospace, Consolas, monospace !important; }
.issued { font-size: 1.4rem !important; letter-spacing: .05em; }
#notice, #dialog-notice { padding: .75rem 1rem; margin-bottom: 1rem; background: #e7f2e6; border: 1px solid #b5d3b6; border-radius: 8px; overflow-wrap: anywhere; }
#notice.error, #dialog-notice.error { color: #732815; background: #fff3ef; border-color: #e8bcb2; }
dialog { color: var(--ink); width: min(28rem, calc(100% - 2rem)); max-height: 90dvh; overflow-y: auto; box-shadow: 0 14px 60px #10271a33; }
dialog::backdrop { background: #10271a66; }
dialog p { overflow-wrap: anywhere; }
dialog dl { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: .35rem 1rem; align-items: start; }
dialog dt { color: var(--muted); }
dialog dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.dialog-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 1.5rem; }
#dialog-notice { margin-top: 1rem; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .bar, .toolbar { flex-wrap: wrap; }
  .toolbar { grid-template-columns: 1fr; }
  .identity { width: 100%; justify-content: space-between; }
  .invite { align-items: start; flex-wrap: wrap; }
  .invite-body { min-width: min(12rem, 100%); }
}
