.account-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sync-status {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
}

.sync-status[data-status="saved"] { color: #486337; }
.sync-status[data-status="error"] { color: var(--danger); background: #fff1ed; }
.sync-status[data-status="loading"], .sync-status[data-status="pending"] { color: #87501f; }

.account-menu { position: relative; }
.account-menu summary {
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 10px 16px;
  font-weight: 750;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-popover {
  position: absolute;
  z-index: 40;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 230px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.account-popover a,
.account-popover button,
.account-import {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 11px 14px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-popover form:last-child button { border-bottom: 0; }
.account-import input { display: none; }

.global-warning {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto 14px;
  border: 1px solid #d2a35c;
  border-radius: 12px;
  background: #fff5dc;
  padding: 12px 14px;
}

.plan-move-controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  min-height: 40px;
  margin-bottom: 8px;
}
.plan-drag-handle { text-align: left; cursor: grab; }
.day-card.is-dragging { opacity: .48; }
.day-card.is-drop-target { outline: 3px dashed #c27635; outline-offset: 3px; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-shell { width: min(100%, 560px); margin: auto; }
.installer-shell { width: min(100%, 780px); }
.auth-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 40px);
}
.stack-form { display: grid; gap: 14px; }
.stack-form h2 { margin-top: 16px; font-size: 1.15rem; }
.auth-link { margin: 18px 0 0; text-align: center; }
.legal-links { display: flex; justify-content: center; gap: 16px; margin-top: 22px; font-size: .85rem; }
.notice { margin: 12px 0; border-radius: 12px; padding: 12px 14px; }
.notice.success { background: #edf5e8; color: #36562e; }
.notice.error { background: #fff0eb; color: #8c3026; }
.notice.warning { background: #fff5dc; color: #79501c; }
.requirement-list { display: grid; gap: 7px; margin: 18px 0; }
.requirement { border-radius: 10px; padding: 9px 11px; background: var(--surface-soft); }
.requirement.ok strong { color: #4f6b3b; }
.requirement.bad strong { color: var(--danger); }

.admin-wrap,
.account-wrap {
  width: min(1160px, calc(100% - 32px));
  margin: 28px auto 60px;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.admin-nav a { text-decoration: none; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px; }
.stat-card strong { display: block; font-size: 1.8rem; }
.admin-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 20px; margin-bottom: 18px; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--border); padding: 10px; text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { min-height: 40px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
.code-box { overflow: auto; padding: 12px; border-radius: 10px; background: #2e2722; color: #f8ead9; font-family: ui-monospace, monospace; }
.danger-zone { border-color: #e2b8b0; }

@media (max-width: 760px) {
  .account-area { width: 100%; justify-content: space-between; }
  .account-popover { right: 0; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-header { align-items: stretch; flex-direction: column; }
  .plan-move-controls { grid-template-columns: 1fr auto auto; }
}
