/* Account pages (wiki PRDs 18 and 22): login, register, welcome and the parent's account. Builds on site.css. */
.acct { padding-top: 24px; padding-bottom: 64px; display: grid; gap: 20px; }
.acct > *, .acct [data-ready], .acct [data-ready] > *, .acct [data-role] > * { min-width: 0; } /* let wide tables scroll inside their card */
.acct [data-ready], .acct [data-role] { display: grid; gap: 20px; }
.acct [hidden] { display: none; }
.acct h1 { font-size: clamp(28px, 5vw, 38px); margin: 0 0 4px; }
.acct h2 { font-size: 22px; margin: 0 0 12px; color: var(--brand); }
.acct h3 { font-size: 17px; margin: 24px 0 4px; }
.acct-card { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 5px 0 var(--line); }
.narrow-card { width: 100%; max-width: 480px; margin: 0 auto; text-align: center; }
.narrow-card form { text-align: left; }
.acct .small { font-size: 14px; }
.acct form { display: grid; gap: 14px; margin: 16px 0; }
.field { display: grid; gap: 4px; font-weight: 700; }
.field small { font-weight: 400; color: var(--mute); font-size: 14px; line-height: 1.5; }
.acct input:not([type="checkbox"]):not([type="radio"]), .acct select { width: 100%; min-height: 48px; font: 400 17px var(--font-body); color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.acct input:focus, .acct select:focus { outline: 3px solid var(--brand-bright); outline-offset: 1px; border-color: var(--brand); }
.pre { display: flex; align-items: center; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.acct .pre select { flex: none; width: auto; min-height: 44px; border: 0; border-right: 2px solid var(--line); border-radius: 10px 0 0 10px; background: var(--paper); font-weight: 700; color: var(--mute); padding: 0 6px 0 10px; }
.acct .pre input:not([type="checkbox"]):not([type="radio"]) { border: 0; min-height: 44px; padding-left: 4px; }
.pre:focus-within { border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; cursor: pointer; line-height: 1.5; padding-top: 10px; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.roles { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.roles legend { font-weight: 700; margin-bottom: 4px; }
.roles label { cursor: pointer; }
.roles input { position: absolute; opacity: 0; }
.roles span { display: grid; gap: 2px; text-align: center; padding: 12px 8px; border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 4px 0 var(--line); }
.roles small { color: var(--mute); font-size: 13px; line-height: 1.4; }
.roles input:checked + span { border-color: var(--brand); background: var(--tint); box-shadow: 0 4px 0 var(--brand); }
.roles input:focus-visible + span { outline: 3px solid var(--brand-bright); outline-offset: 2px; }
.acct-err { color: #B91C1C; font-weight: 700; margin: 0; }
.acct-err[hidden] { display: none; }
.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.acct-head p { margin: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { font-weight: 700; color: var(--mute); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; color: var(--mute); background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 0 10px; }
.tag:empty { display: none; }
.rows { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.btns { display: flex; gap: 4px 12px; flex-wrap: wrap; }
button.link { background: none; border: 0; padding: 8px 0; min-height: 44px; font: 700 15px var(--font-body); color: var(--brand); cursor: pointer; text-decoration: underline; }
button.link.danger { color: #B91C1C; }
.code { font: 900 34px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .2em; color: var(--brand); background: var(--tint); border-radius: 12px; padding: 10px 16px; display: inline-block; margin: 4px 0 12px; }
.code[hidden] { display: none; }
form.inline { display: flex; gap: 8px; margin: 8px 0; }
form.inline input { flex: 1; min-width: 0; }
form.inline .btn { flex: none; min-height: 48px; padding: 8px 18px; }
.note { background: #FFFBEB; border: 2px solid #FDE68A; border-radius: 12px; padding: 10px 14px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters select { flex: 0 1 180px; }
.filters input { flex: 1 1 220px; }
.scroll { overflow-x: auto; }
.grid { border-collapse: collapse; width: 100%; font-size: 15px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; white-space: nowrap; }
.grid th { background: var(--paper); }
.grid tr.off td { color: var(--mute); background: #F9FAFB; }
.grid .btns { flex-wrap: nowrap; }
.acct-dialog { border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(420px, calc(100vw - 32px)); }
.acct-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.acct-dialog form { display: grid; gap: 12px; }
.acct-dialog h2 { margin: 0; color: var(--brand); font-size: 22px; }
.acct-dialog .row { display: flex; gap: 8px; }
.acct-dialog .field input { width: 100%; min-height: 48px; font: 400 17px var(--font-body); border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; }
@media (max-width: 420px) { .top .acts .btn-sm { padding: 8px 12px; letter-spacing: .02em; } }
/* 檢視帳戶 (PRD 22): the admin is looking at someone else's account, read only. */
.viewbar { background: #FEF3C7; border-bottom: 2px solid #F59E0B; color: #78350F; font-weight: 700; }
.viewbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.viewbar b { overflow-wrap: anywhere; }
.viewbar .btn { background: #78350F; color: #fff; box-shadow: none; }
.viewbar[hidden] { display: none; }
.rows .city-line { display: block; margin-top: 4px; font-size: 15px; }
.rows .city-line select { font: inherit; padding: 2px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
