*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh; padding: 64px 16px 40px; background: var(--ut-page); color: var(--ut-ink);
  font-family: 'IBM Plex Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}

a { color: var(--ut-link); text-decoration: none; }
a:hover { color: var(--ut-link-hover); }
:focus-visible { outline: 2px solid var(--ut-focus); outline-offset: 3px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.card { width: 100%; max-width: 420px; background: var(--ut-surface); border: 1px solid var(--ut-border); border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.footnote { margin: 0; max-width: 420px; text-align: center; font-size: 12px; line-height: 1.7; color: var(--ut-muted); }

.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--ut-hover); border-radius: 10px; }
.tab { height: 40px; border-radius: 8px; font-weight: 500; color: var(--ut-ink); display: flex; align-items: center; justify-content: center; }
.tab:hover { color: var(--ut-ink); }
.tab[aria-current='page'] { background: var(--ut-surface); }

form, .stack { display: flex; flex-direction: column; gap: 16px; }
h1 { margin: 0; font-size: 20px; font-weight: 600; }
p { margin: 0; line-height: 1.7; color: var(--ut-secondary); }
.small { font-size: 13px; }
.muted { color: var(--ut-muted); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
label { font-size: 13px; font-weight: 500; }
.hint { font-size: 12px; color: var(--ut-muted); }
input { height: 44px; border: 1px solid var(--ut-input-border); border-radius: 8px; padding: 0 12px; font: inherit; color: var(--ut-ink); background: var(--ut-surface); width: 100%; transition: border-color 160ms ease; }
input:hover, textarea:hover { border-color: var(--ut-muted); }
input:focus, textarea:focus { border-color: var(--ut-accent); }
.code-input { height: 52px; font-family: 'IBM Plex Mono', monospace; font-size: 22px; letter-spacing: 8px; }

.btn { height: 40px; border: 0; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; }
.btn-primary { background: var(--ut-action); color: var(--ut-on-action); }
.btn-primary:hover { background: var(--ut-action-hover); color: var(--ut-on-action); text-decoration: none; }
.btn-dark { background: var(--ut-ink); color: var(--ut-surface); align-self: flex-start; }
.btn-dark:hover { color: var(--ut-surface); }
.btn-secondary { background: var(--ut-surface); color: var(--ut-ink); border: 1px solid var(--ut-input-border); font-weight: 400; }
.btn-secondary:hover { background: var(--ut-hover); color: var(--ut-ink); text-decoration: none; }
.link-center { font-size: 13px; text-align: center; }

.alert { border-radius: 8px; background: var(--ut-danger-soft); color: var(--ut-danger); padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.notice { border-radius: 8px; background: var(--ut-success-soft); color: var(--ut-success); padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.done-mark { width: 40px; height: 40px; border-radius: 20px; background: var(--ut-success-soft); display: flex; align-items: center; justify-content: center; }
.secret { font-family: 'IBM Plex Mono', monospace; font-size: 13px; background: var(--ut-page); border: 1px solid var(--ut-border); border-radius: 8px; padding: 12px; word-break: break-all; line-height: 1.7; margin: 0; }

/* Account and management pages */
body.console { padding: 0; align-items: stretch; gap: 0; }
.console-content { display: flex; flex-direction: column; gap: 20px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel { background: var(--ut-surface); border: 1px solid var(--ut-border); border-radius: 14px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
h3 { margin: 8px 0 0; font-size: 14px; font-weight: 600; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-danger { background: var(--ut-danger); color: var(--ut-surface); }
.btn-danger:hover { background: var(--ut-danger); color: var(--ut-surface); }
.self-start { align-self: flex-start; }
.narrow { max-width: 420px; }
.grow { flex: 1; }
.row-form { flex-direction: row; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
.facts dt { color: var(--ut-muted); font-size: 13px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--ut-hover); color: var(--ut-secondary); font-size: 12px; }
.tag-good { background: var(--ut-success-soft); color: var(--ut-success); }
.tag-warn { background: var(--ut-warning-soft); color: var(--ut-warning); }
.tag-bad { background: var(--ut-danger-soft); color: var(--ut-danger); }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.7; color: var(--ut-secondary); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ut-muted); padding: 8px 10px; border-bottom: 1px solid var(--ut-border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--ut-hover); vertical-align: top; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pager { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.mono, code { font-family: 'IBM Plex Mono', monospace; }
.mono { overflow-wrap: anywhere; }
code { font-size: 12px; background: var(--ut-page); padding: 1px 5px; border-radius: 4px; }
textarea { border: 1px solid var(--ut-input-border); border-radius: 8px; padding: 10px 12px; font: inherit; color: var(--ut-ink); width: 100%; resize: vertical; }
fieldset { border: 0; margin: 0; padding: 0; }
.legend { font-size: 13px; font-weight: 500; padding: 0; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.radio input { width: auto; height: auto; }
.role-form { gap: 6px; min-width: 140px; }
.users-table { min-width: 960px; }
.users-table .tag, .users-table td:nth-child(4) { white-space: nowrap; }
.role-form select { height: 36px; width: 100%; border: 1px solid var(--ut-input-border); border-radius: 8px; padding: 0 8px; font: inherit; color: var(--ut-ink); background: var(--ut-surface); }
.role-form .btn { align-self: flex-start; }
.role-form .btn:hover { background: var(--ut-page); }

.account-layout { display: grid; grid-template-columns: var(--ut-nav-width) minmax(0, 1fr); gap: 32px; align-items: start; }
.account-menu { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 24px; }
.account-menu a { padding: 12px 16px; border-radius: 8px; color: var(--ut-secondary); text-decoration: none; }
.account-menu a:hover { background: var(--ut-hover); text-decoration: none; }
.account-menu a[aria-current="page"] { background: var(--ut-blue-100); color: var(--ut-ink); font-weight: 600; }
.account-content { min-width: 0; }
.profile-facts > div { align-items: baseline; }
.profile-name { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.profile-name > span { min-width: 0; }
.account-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ut-link); font: inherit; cursor: pointer; flex-shrink: 0; }
.account-action:hover { color: var(--ut-link-hover); text-decoration: underline; text-underline-offset: 3px; }
.phone-binding-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-weight: 400; cursor: pointer; }
.check-label input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: var(--ut-action); }
.account-pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; color: var(--ut-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pager-control { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--ut-border); border-radius: var(--ut-radius-small); color: var(--ut-secondary); }
.pager-control:hover { background: var(--ut-hover); }
.pager-control[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.account-edit { width: 100%; max-width: 360px; gap: 16px; }
.security-group { margin-top: 10px; }
.security-group h3 { margin: 0 0 8px; color: var(--ut-muted); font-size: 13px; }
.security-list { margin: 0; }
.security-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(132px, 180px) 92px; align-items: center; gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--ut-border-subtle); }
.security-row dt { font-weight: 500; }
.security-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.security-description { color: var(--ut-muted); font-size: 13px; line-height: 1.7; }
.security-status { display: flex; align-items: flex-start; flex-direction: column; gap: 6px; }
.security-action { justify-self: end; text-align: right; }
.security-editor { grid-column: 2 / -1; padding: 8px 0; }
@media (min-width: 761px) and (max-width: 1100px) {
  .security-row { grid-template-columns: 96px minmax(0, 1fr) 100px; }
  .security-description { grid-column: 2; }
  .security-status { grid-column: 2; }
  .security-action { grid-column: 3; grid-row: 1 / span 2; }
  .security-row dt { grid-row: 1 / span 2; }
}
@media (max-width: 600px) {
  .profile-facts > div { grid-template-columns: 64px minmax(0, 1fr); }
  .security-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .security-row dt { grid-column: 1; }
  .security-description { grid-column: 1 / -1; grid-row: 2; }
  .security-status { grid-column: 1 / -1; grid-row: 3; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .security-action { grid-column: 2; grid-row: 1; }
  .security-editor { grid-column: 1 / -1; grid-row: 4; }
}
@media (max-width: 760px) { .account-layout { grid-template-columns: 1fr; gap: 20px; } .account-menu { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; } .account-menu a { white-space: nowrap; flex-shrink: 0; } .panel { padding: 20px 16px; } }

/* Shared account identity; form behavior belongs to the original Razor pages. */
body.auth-entry { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 100svh; padding: 0; gap: 0; }
.auth-entry .ut-header { width: 100%; }
.auth-home-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-left: auto; color: var(--ut-muted); font-size: 12px; }
.auth-home-link svg, .auth-product-context > a svg { width: 16px; height: 16px; }
.auth-entry-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; align-items: center; gap: 96px; flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 64px 24px 72px; }
.auth-product-context { min-width: 0; }
.auth-product-context h2 { font-size: clamp(32px, 3.2vw, 44px); font-weight: 500; line-height: 1.45; letter-spacing: -.025em; }
.auth-product-context > p { margin-top: 24px; max-width: 38ch; color: var(--ut-muted); font-size: 15px; line-height: 1.9; }
.auth-product-list { display: grid; gap: 0; margin: 28px 0 0; }
.auth-product-list > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: baseline; gap: 16px; padding: 16px 0; border-top: 1px solid var(--ut-border); }
.auth-product-list dt { color: var(--ut-ink); font-size: 16px; font-weight: 500; }
.auth-product-list dd { margin: 0; color: var(--ut-muted); font-size: 12px; line-height: 1.9; }
.auth-product-context > a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; font-size: 13px; }
.auth-form-column { min-width: 0; }
.auth-entry .card { gap: 24px; padding: 32px; }
.auth-entry .card h1 { font-size: 23px; }
.auth-entry form { gap: 20px; }
.auth-entry .tabs { padding: 0; gap: 24px; background: transparent; border-bottom: 1px solid var(--ut-border); border-radius: 0; }
.auth-entry .tab { min-height: 44px; height: auto; border-bottom: 2px solid transparent; border-radius: 0; color: var(--ut-muted); }
.auth-entry .tab[aria-current=page] { background: transparent; color: var(--ut-ink); border-bottom-color: var(--ut-accent); }
.auth-entry .tab:hover { color: var(--ut-ink); text-decoration: none; }
.auth-entry .footnote { max-width: 36ch; margin: 18px auto 0; line-height: 1.9; font-size: 11px; }
.account-page-heading p { margin-top: 8px; font-size: 13px; }
.account-content > .panel { padding: 28px; }
.account-content .panel > h2 { font-size: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--ut-border); }
.profile-facts > div { padding: 12px 0; border-bottom: 1px solid var(--ut-border-subtle); }
.account-menu a { min-height: 44px; padding: 10px 16px; }
@media (max-width: 1000px) { .auth-entry-layout { gap: 48px; grid-template-columns: minmax(0, 1fr) 400px; } }
@media (max-width: 800px) { .auth-entry-layout { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 36px 20px 48px; } .auth-product-context { width: 100%; max-width: 420px; } .auth-product-context h2 { font-size: 28px; } .auth-product-context h2 br { display: none; } .auth-product-context > p { margin-top: 12px; font-size: 13px; } .auth-product-list, .auth-product-context > a { display: none; } .auth-form-column { width: 100%; max-width: 420px; } }
@media (max-width: 480px) { .auth-entry .card { padding: 28px 24px; } .auth-entry .card h1 { font-size: 21px; } .account-content > .panel { padding: 20px 16px; } }
@media (max-width: 360px) { .auth-home-link { font-size: 11px; } .auth-home-link svg { display: none; } .auth-entry .ut-brand-context { display: none; } .auth-entry .card { padding: 24px 20px; } }
