:root {
  color-scheme: light;
  font: 15px/1.5 system-ui, sans-serif;
  color: #243447;
  background: #f7f5f0;
  --text: #243447;
  --muted: #53616b;
  --accent: #286560;
  --border: #d4dada;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; }
.account-bar {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 8px clamp(12px, 3vw, 24px);
  background: #fff;
  border-bottom: 1px solid var(--border);
}
#account { margin-right: auto; overflow-wrap: anywhere; }
#status { font-size: .85rem; color: var(--muted); }
#status[data-tone="review"] { color: #87480e; font-weight: 650; }
iframe { border: 0; flex: 1; width: 100%; min-height: 0; }

button, input { font: inherit; }
button {
  border: 1px solid #d4dada;
  border-radius: 9px;
  padding: 8px 12px;
  min-height: 40px;
  color: var(--accent);
  background: #fff;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #f1f4f4; border-color: #a1b3b8; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid #617c89; outline-offset: 3px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 650; }
button.primary:hover:not(:disabled) { background: #1e514e; border-color: #1e514e; }
button.danger { color: #9b3138; }

dialog {
  inset: 0;
  margin: auto;
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(16px, 4vw, 24px);
  color: var(--text);
  background: #fff;
  box-shadow: 0 24px 80px #24344739;
}
dialog::backdrop { background: #172c3666; }
dialog h1 { font-size: 1.55rem; letter-spacing: -.025em; margin: 0 0 3px; }
dialog h2 { margin: 0 0 4px; font-size: 1rem; }
dialog p { margin: 0 0 10px; color: var(--muted); }
.profile-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.profile-heading p { overflow-wrap: anywhere; margin: 0; }
.close-button { flex: 0 0 40px; padding: 0; font-size: 1.35rem; line-height: 1; }
.profile-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  border-radius: 9px;
  background: #eaf0f4;
  color: #1e514e;
  padding: 8px 12px;
  font-size: .9rem;
  font-weight: 600;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.profile-sync[data-tone="review"] { color: #79410e; background: #fbf1df; }
.sync-review { margin-top: 12px; border: 1px solid #ecd5b5; border-radius: 12px; padding: 12px; background: #fffbf3; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-section, #panel details, #profile-footer { border-top: 1px solid var(--border); margin-top: 15px; padding-top: 12px; }
#panel details > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
#panel details > p { margin-top: 8px; }
.profile-message { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; margin-top: 12px; }
.profile-message:empty, #welcome-status:empty { display: none; }
#code-entry { margin-top: 10px; }
#code-entry label { display: block; font-weight: 600; margin-bottom: 4px; }
.code-row { display: flex; gap: 8px; flex-wrap: wrap; }
.code-row input { flex: 1; min-width: 10em; border: 1px solid #a1b3b8; border-radius: 8px; padding: 8px 10px; }

.account-bar { background: #243447; color: white; padding: 5px clamp(12px,3vw,38px); border-color: #3b505e; }
.account-bar #status { color: #d6e1e5; }
.account-bar #status[data-tone="review"] { color: #ffdb9b; }
.account-bar button { color: white; background: #354b5c; border-color: #667b86; padding: 4px 12px; min-height: 34px; }
.account-bar button:hover:not(:disabled) { background: #415f70; border-color: #abc2cc; }
.account-bar button:focus-visible { outline-color: #b7dad6; }
dialog { border-radius: 12px; }
dialog h1 { font: 500 1.85rem/1.16 Georgia,Cambria,serif; }
