body { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif; max-width: 520px; margin: 48px auto; padding: 0 16px; color: #1a1a1c; line-height: 1.7; }
h1 { font-size: 1.25rem; }
.warn { color: #c5221f; }
.muted { color: #4d4d52; }
#post-form { display: none; }

/* ログイン画面 */
body.login {
  --c-primary: #0031d8;
  --c-primary-hover: #0017c1;
  --c-text: #1a1a1c;
  --c-sub: #4d4d52;
  --c-border: #c8c8cb;
  --c-bg: #f1f1f4;
  --c-surface: #ffffff;
  --c-error: #c5221f;
  --c-error-bg: #fdeeee;
  --radius: 12px;
  max-width: none;
  margin: 0;
  padding: 40px 16px 64px;
  min-height: 100vh;
  box-sizing: border-box;
  background: var(--c-bg);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
body.login *,
body.login *::before,
body.login *::after { box-sizing: border-box; }

.login-card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 36px 32px 28px;
}
.login-head { margin-bottom: 20px; }
.login-eyebrow {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--c-primary);
}
.login-head h1 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.4; }
.login-lead { margin: 0; color: var(--c-sub); font-size: 0.95rem; }

.status {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f4f6fb;
  font-size: 0.92rem;
}
.status.warn {
  background: var(--c-error-bg);
  color: var(--c-error);
  font-weight: 600;
}
.status:empty { display: none; }

.step-block + .step-block { margin-top: 8px; }
.login-section { margin-top: 4px; }
.section-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

#gsi-host {
  min-height: 44px;
  display: flex;
  justify-content: flex-start;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 20px;
  color: var(--c-sub);
  font-size: 0.85rem;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 700;
}
.field input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #7f7f84;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--c-text);
}
.field input:focus {
  outline: 3px solid #ffd43d;
  outline-offset: 1px;
  border-color: var(--c-text);
}
.code-input {
  letter-spacing: 0.4em;
  font-size: 1.4rem !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn:focus-visible { outline: 3px solid #ffd43d; outline-offset: 2px; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-hover); }
.btn-secondary { background: #fff; color: var(--c-primary); border-color: var(--c-primary); }
.btn-secondary:hover { background: #e8f1fe; }

.btn-link {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.92rem;
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover { color: var(--c-primary-hover); }

.sub-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #f8f8fb;
  border: 1px solid #e0e0e4;
}
.hint { margin: 0 0 14px; color: var(--c-sub); font-size: 0.92rem; }

.enroll-steps {
  margin: 0 0 16px;
  padding-left: 1.4em;
  font-size: 0.95rem;
}
.enroll-steps li { margin-bottom: 6px; }
.qr-host {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}
.qr-host img {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  border: 1px solid #e0e0e4;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.manual-key { margin: 0 0 18px; font-size: 0.92rem; }
.manual-key summary { cursor: pointer; color: var(--c-primary); }
.secret-key {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f4f6fb;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.login-foot {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e6e6ea;
}
.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text);
  text-decoration: none;
}
.guide-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.beginner-mark {
  width: 18px;
  height: 25px;
  flex: none;
}

.btn:disabled { opacity: 0.5; cursor: wait; }
a.btn { text-align: center; text-decoration: none; line-height: 24px; }

.step-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e8f1fe;
  color: var(--c-primary);
  font-size: 0.82rem;
  font-weight: 700;
}
.step-badge.done { background: #e6f4ea; color: #137333; }

.field input[readonly] { background: #f4f4f6; color: var(--c-sub); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 72px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  min-width: 56px;
  height: 36px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 0.85rem;
  color: var(--c-primary);
  cursor: pointer;
}
.pw-toggle:focus-visible { outline: 3px solid #ffd43d; outline-offset: 1px; }

.pw-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 16px;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}
.pw-rules li {
  padding: 2px 10px;
  border-radius: 999px;
  background: #f1f1f4;
  color: var(--c-sub);
}
.pw-rules li::before { content: "・"; }
.pw-rules li.ok { background: #e6f4ea; color: #137333; font-weight: 700; }
.pw-rules li.ok::before { content: "✓ "; }

.help-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 14px;
  border: 1px solid var(--c-primary);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--c-primary);
  cursor: pointer;
}
.help-chip:hover { background: #e8f1fe; }
.help-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.8rem;
}

.same-device {
  display: none;
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 8px;
  background: #fff8e1;
  border: 1px solid #f2d27a;
}
.same-device .hint { margin-bottom: 10px; color: #5c4400; }

.foot-note { margin: 0; font-size: 0.85rem; color: var(--c-sub); }

.help-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  color: var(--c-text);
}
.help-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.help-body { padding: 24px 22px 20px; font-size: 0.98rem; line-height: 1.75; }
.help-body h2 { margin: 0 0 8px; font-size: 1.2rem; }
.help-body h3 { margin: 18px 0 6px; font-size: 1rem; }
.help-body p { margin: 0 0 12px; color: var(--c-sub); }
.help-steps { margin: 0; padding-left: 1.4em; }
.help-steps li { margin-bottom: 12px; }
.help-steps b { display: block; }
.help-steps span { display: block; color: var(--c-sub); }
.store-links { display: flex !important; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.store-links a {
  padding: 6px 12px;
  border: 1px solid var(--c-primary);
  border-radius: 6px;
  color: var(--c-primary);
  font-weight: 700;
  text-decoration: none;
}
.store-links { align-items: flex-start; }
.store-links a.store-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  font-weight: 400;
}
.store-badge img { display: block; height: 40px; width: auto; }
.store-badge-google img { height: 54px; margin: -7px 0; }
.store-badge small { font-size: 0.78rem; color: var(--c-sub); }
.store-badge:focus-visible { outline: 3px solid #ffd43d; outline-offset: 2px; }
.help-trouble { margin: 0 0 18px; padding-left: 1.2em; color: var(--c-sub); }

@media (max-width: 480px) {
  body.login { padding: 16px 12px 40px; }
  .login-card { padding: 28px 20px 24px; }
  .login-head h1 { font-size: 1.3rem; }
}

.loading-overlay { position: fixed; inset: 0; z-index: 2000; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(255, 255, 255, 0.85); }
.loading-overlay img { display: block; }
.loading-overlay p { margin: 0; font-size: 15px; font-weight: 700; color: #1a1a1c; }
