.auth-page { display: flex; flex-direction: column; min-height: 100dvh; }
.auth-topbar { width: 100%; max-width: none; padding: 22px clamp(20px,5vw,76px); border-bottom: 1px solid #ffffff0d; }
.auth-shell { flex: 1; display: grid; grid-template-columns: 1fr 440px; align-items: center; gap: clamp(36px,8vw,130px); width: min(1120px,100%); max-width: none; padding: 42px 28px; }
.auth-intro { min-width: 0; }
.auth-login-shell { grid-template-areas: "visitor form" "intro form"; grid-template-rows: auto 1fr; row-gap: 22px; }
.auth-login-shell .auth-intro { grid-area: intro; align-self: start; }
.auth-login-shell .auth-panel { grid-area: form; align-self: start; inline-size: 100%; }
.auth-visitor-actions {
  grid-area: visitor;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.auth-visitor-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  gap: 6px 8px;
  min-block-size: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}
.auth-visitor-link-primary {
  border-color: color-mix(in srgb, #8d73d8 62%, var(--line));
  background: color-mix(in srgb, #8d73d8 14%, var(--panel));
}
.auth-visitor-link:hover, .auth-visitor-link:focus-visible { border-color: #8d73d8; }
.auth-visitor-link:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.auth-visitor-link strong { font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.auth-visitor-arrow { color: var(--link); font-size: 17px; line-height: 1.45; }
.auth-visitor-summary { grid-column: 1 / -1; color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-emblem { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid #7c60b9; border-radius: 20px; background: linear-gradient(145deg,#46316b,#20283e); color: #ffd37b; font-size: 32px; margin-bottom: 24px; }
.auth-intro h1 { font-size: clamp(30px,4vw,50px); font-weight: 600; line-height: 1.35; margin: 12px 0 16px; }
.auth-intro > p:not(.eyebrow) { font-size: 14px; line-height: 1.9; color: #a4b0ca; margin-bottom: 26px; }
.auth-feature { display: flex; align-items: center; gap: 12px; color: #c5cce0; font-size: 13px; margin-top: 14px; }
.auth-feature > span { flex: 0 0 24px; color: #d9bdff; font-size: 20px; text-align: center; }
.auth-panel { min-width: 0; padding: 30px; border: 1px solid #3a4160; border-radius: 18px; background: #181e31e8; box-shadow: 0 24px 80px #0003; }
.auth-panel h2 { margin: 8px 0; font-size: 27px; font-weight: 500; line-height: 1.35; }
.auth-subtitle { color: #98a6c1; font-size: 13px; margin: 8px 0 24px; line-height: 1.7; }
.auth-beta-notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #8d73d8 42%, var(--line));
  border-inline-start: 3px solid #8d73d8;
  border-radius: 8px;
  background: color-mix(in srgb, #8d73d8 10%, var(--panel));
}
.auth-beta-notice h3 { margin: 0; color: var(--text); font-size: 14px; line-height: 1.5; }
.auth-beta-notice p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-form { display: grid; gap: 15px; }
.auth-form label { font-size: 13px; color: #cdd5e9; font-weight: 400; }
.auth-form input { min-height: 44px; font-size: 14px; border-color: #3d4869; }
.auth-form input:focus { outline: 2px solid #8d73d8; outline-offset: 1px; }
.auth-form .auth-remember { display: flex; align-items: center; gap: 8px; width: fit-content; cursor: pointer; }
.auth-form .auth-remember input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: #8d73d8; }
.auth-form .auth-forgot { justify-self: end; margin-top: -4px; font-size: 12px; }
.auth-panel a, .account-page a { color: #c9b4ff; text-decoration: none; }
.auth-panel a:hover, .account-page a:hover { text-decoration: underline; }
.auth-panel .button, .account-panel .button { color: #1a1408; }
.auth-submit { width: 100%; text-align: center; min-height: 44px; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: #7889a9; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #323d58; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 11px; border: 1px solid #515b75; border-radius: 8px; background: #f6f7fa; color: #26334a !important; text-decoration: none !important; font: 500 13px Kanit,sans-serif; cursor: pointer; }
.google-mark { font: 700 20px Arial,sans-serif; color: #4285f4; }
.google-button:hover { background: #e9edf6; }
.google-button:disabled, .auth-form button:disabled { opacity: .45; cursor: not-allowed; }
.auth-switch { margin: 24px 0 0; color: #9caac4; text-align: center; font-size: 13px; }
.auth-small { color: #8f9eb9; font-size: 12px; line-height: 1.8; margin: 14px 0 0; }
.auth-form .auth-small { margin: -3px 0 0; }
.auth-privacy { margin: 22px 0 0; color: #7284a5; font-size: 11px; line-height: 1.8; text-align: center; }
.auth-error, .auth-success { padding: 12px; border-radius: 8px; font-size: 13px; line-height: 1.8; margin: 0 0 18px; }
.auth-error { color: #ffb2bf; background: #532b3b; border: 1px solid #7b4057; }
.login-cooldown { margin: 0; padding: 10px 12px; border: 1px solid #67547a; background: #30263f; color: #e7cbff; border-radius: 8px; font-size: 12px; text-align: center; }
.auth-success { color: #b9ead2; background: #234536; border: 1px solid #386a51; }
.auth-footer { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 20px clamp(20px,5vw,76px); color: #8c9cb9; font-size: 10px; border-top: 1px solid #ffffff0d; }
.account-page { max-width: 1040px; margin: 0 auto; }
.room-name-setup { max-width: 460px; }
.room-name-setup .eyebrow { margin: 0; overflow-wrap: anywhere; }
.account-back { display: inline-block; margin-bottom: 22px; font-size: 13px; }
.account-page h1 { margin: 6px 0 10px; }
.account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 20px; margin-top: 24px; }
.account-panel { min-width: 0; border: 1px solid #38435f; background: #182033; border-radius: 12px; padding: 22px; }
.account-panel h2 { font-size: 18px; font-weight: 500; margin: 0 0 18px; }
.account-code { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.account-code code { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.account-room-names, .account-name-history, .account-profile-icon { grid-column: 1 / -1; }
.account-profile-icon { scroll-margin-top: 96px; }
.account-profile-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.account-profile-heading h2 { margin: 0; }
.account-menu-profile-icon { flex: 0 0 20px; font-size: 16px; line-height: 1; text-align: center; }
.profile-icon-options { display: flex; flex-wrap: wrap; gap: 5px; }
.profile-icon-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  cursor: pointer;
}
.profile-icon-choice > span { font-size: 18px; line-height: 1; }
.profile-icon-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.profile-icon-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-icon-default { max-width: 100%; padding-inline: 9px; overflow-wrap: anywhere; }
.account-name-history-heading, .account-name-history-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; }
.account-name-history-heading h2 { margin: 0; }
.account-name-history-heading span, .account-name-history-meta time, .account-name-history-values dt { color: var(--muted); font-size: 12px; }
.account-name-history-list { list-style: none; padding: 0; margin: 12px 0 0; }
.account-name-history-list li { border-top: 1px solid var(--line); padding: 10px 0; overflow-wrap: anywhere; }
.account-name-history-meta strong { font-size: 13px; font-weight: 500; }
.account-name-history-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 7px 0 0; }
.account-name-history-values dd { margin: 2px 0 0; font-size: 14px; }
.account-name-history-pages { flex-wrap: wrap; padding-top: 8px; font-size: 13px; }
.boss-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 10px 16px;
  margin: 12px 0;
}
.boss-history-filter { display: flex; flex: 1 1 27rem; flex-wrap: wrap; align-items: end; gap: 8px; min-width: 0; }
.boss-history-view {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.boss-history-view a {
  padding: 6px 9px;
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}
.boss-history-view a:hover { background: var(--panel); }
.boss-history-view a[aria-current="page"] { background: var(--accent); color: #17120a; font-weight: 700; }
.boss-history-filter label { flex: 1 1 15rem; min-width: 0; max-width: 28rem; }
.boss-history-filter select { width: 100%; min-width: 0; }
.boss-history-panel .account-name-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 10px;
}
.boss-history-panel .account-name-history-list > li { padding: 0; border: 0; }
.boss-history-card {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel) 82%, var(--bg));
}
.boss-history-card-head, .boss-history-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 8px; }
.boss-history-card-head { margin: 0; padding: 0; max-width: none; align-items: start; border: 0; }
.boss-history-identity { display: flex; flex: 1 1 9rem; min-width: 0; align-items: center; gap: 8px; }
.boss-history-thumbnail { flex: 0 0 64px; border-radius: 6px; object-fit: cover; background: var(--bg); }
.boss-history-names { min-width: 0; }
.boss-history-names strong { font-size: 14px; }
.boss-history-names small { display: block; color: var(--muted); font-size: 11px; }
.boss-history-changed, .boss-history-card-foot { color: var(--muted); font-size: 11px; }
.boss-history-changed { white-space: nowrap; }
.boss-history-action { margin: 0; font-size: 13px; font-weight: 500; }
[data-history-source="user"] { --history-source-color: var(--accent); }
[data-history-source="system"] { --history-source-color: #6baaff; }
.boss-history-card, .boss-history-table tbody th[scope="row"] {
  border-inline-start: 3px solid var(--history-source-color);
}
.boss-history-event { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; }
.boss-history-source {
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--history-source-color) 50%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--history-source-color) 18%, var(--panel));
  color: color-mix(in srgb, var(--history-source-color) 30%, var(--text));
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}
.boss-history-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.boss-history-times > div {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.boss-history-times dt { color: var(--muted); font-size: 11px; }
.boss-history-times dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.boss-history-times time { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.boss-history-times strong, .boss-history-empty-time { color: var(--link, #c9b4ff); font-size: 19px; line-height: 1.25; }
.boss-history-times time span { color: var(--muted); font-size: 10px; }
.boss-history-card-foot { padding-top: 6px; border-top: 1px solid var(--line); }
.boss-history-email { overflow-wrap: anywhere; }
.boss-history-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}
.boss-history-table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boss-history-table { width: 100%; min-width: 50rem; border-collapse: collapse; font-size: 12px; }
.boss-history-table :is(th, td) { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; }
.boss-history-table thead { background: var(--panel); color: var(--muted); }
.boss-history-table tbody tr:last-child > * { border-bottom: 0; }
.boss-history-table tbody tr:hover { background: color-mix(in srgb, var(--panel) 65%, var(--bg)); }
.boss-history-table th[scope="row"] { min-width: 9rem; overflow-wrap: anywhere; }
.boss-history-table td:last-child { min-width: 8rem; overflow-wrap: anywhere; }
.boss-history-table time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.boss-history-table .boss-history-thumbnail { flex-basis: 48px; width: 48px; height: 27px; }
.account-room-names h2 { margin-bottom: 6px; }
.account-room-name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding-block: 12px; border-top: 1px solid var(--line); }
.account-room-name-row:last-child { padding-bottom: 0; }
.account-room-name-row label { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.account-room-name-row .button { white-space: nowrap; }
.account-panel .auth-form > button { justify-self: start; }
.account-panel .auth-form > .google-button { justify-self: stretch; }
.account-panel .button.outline { color: #d4c3ff; }
.account-email { overflow-wrap: anywhere; font-size: 14px; color: #e3d9fc; }
.account-linked { color: #95dab7; font-size: 13px; }
.account-unlink { margin-top: 20px; font-size: 12px; color: #d7acc3; }
.account-unlink summary { cursor: pointer; margin-bottom: 14px; }
@media(max-width:900px) { .auth-shell { grid-template-columns: minmax(0,1fr) minmax(320px,400px); gap: 30px; } .auth-panel { padding: 24px; } .app-topbar { flex-wrap: wrap; } .app-topbar nav { flex-wrap: wrap; justify-content: flex-end; } }
@media(max-width:650px) { .auth-topbar { padding: 18px; } .auth-shell { display:block; padding:24px 16px; max-width:480px; } .auth-intro { display:none; } .auth-panel { padding:24px 20px; } .auth-footer { padding:16px; } .account-grid { grid-template-columns:minmax(0,1fr); } .app-topbar { justify-content: space-between; } .app-topbar nav { gap:6px; } }
@media (max-width: 650px) {
  .auth-login-shell { display: flex; flex-direction: column; align-items: stretch; gap: 24px; }
  .auth-visitor-actions { order: -1; align-self: stretch; }
  .auth-login-shell .auth-intro { order: 1; align-self: stretch; display: block; padding: 0 4px 16px; }
  .auth-login-shell .auth-emblem { display: none; }
  .auth-login-shell .auth-intro h1 { margin-top: 0; font-size: 23px; }
}
@media (max-width: 375px) {
  .auth-visitor-actions { grid-template-columns: 1fr; }
  .auth-visitor-link { min-block-size: 82px; }
}
