/* Account menu: one button in the header, its items in a drop-down. */
.account-menu { position: relative; flex: none; }
.account-button {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; cursor: pointer;
}
.account-button:hover { border-color: var(--muted); }
.account-button .caret { transition: transform .15s; }
.account-button[aria-expanded="true"] .caret { transform: rotate(180deg); }
.account-items {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 230px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 10px 30px rgba(20, 23, 28, .16);
}
.account-items:not([hidden]) { display: grid; }
.account-email { margin: 0; padding: 8px 12px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-email:empty { display: none; }
.account-items button { text-align: left; background: none; border: 0; border-radius: 9px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--text); cursor: pointer; }
.account-items button:hover, .account-items button:focus-visible { background: var(--accent-soft); outline: none; }

/* Phones: a smaller brand so it and the account button share one line. */
@media (max-width: 560px) {
  .brand { font-size: 18px; }
  .brand-tag { font-size: 14px; }
  .account-button { padding: 7px 10px; font-size: 14px; }
}
@media (max-width: 440px) {
  .account-button span { display: none; }
}
.site-header .brand { white-space: nowrap; }

/* Sync from a link */
.feed-card { margin-top: 18px; }
.feed-card .steps { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.feed-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feed-status { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.feed-status.error { background: #fde8e8; color: #8a1c1c; }
@media (prefers-color-scheme: dark) { .feed-status.error { background: #3a1717; color: #ffb4b4; } }
.feed-status p { margin: 0; }
.feed-status details { margin-top: 8px; }
.feed-status ul { margin: 6px 0 0; padding-left: 20px; }

/* A button that's working: faded, with a spinner, not clickable. */
.button.busy { opacity: .7; pointer-events: none; }
.button.busy::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-message { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--accent-soft); }
.auth-message.error { background: #fde8e8; color: #8a1c1c; }
@media (prefers-color-scheme: dark) { .auth-message.error { background: #3a1717; color: #ffb4b4; } }
.auth-sent { text-align: center; }
.auth-sent .sent-icon { font-size: 34px; color: var(--accent); }
.auth-sent h2 { margin: 6px 0 8px; }
.auth-sent p { margin: 0 0 10px; }
.sent-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; }
.brand-tag { font-weight: 500; color: var(--muted); font-size: 16px; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.portal { padding-top: 8px; padding-bottom: 24px; }
.portal h1 { font-size: clamp(28px, 4.5vw, 40px); letter-spacing: -0.02em; line-height: 1.15; margin: 8px 0 10px; }
.portal h2 { font-size: 20px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.optional { color: var(--muted); font-weight: 400; font-size: 13px; }

.notice { background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.notice.error { background: #fde8e8; color: #8a1c1c; }
@media (prefers-color-scheme: dark) { .notice.error { background: #3a1717; color: #ffb4b4; } }

#view-signed-out:not([hidden]) { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { #view-signed-out:not([hidden]) { grid-template-columns: 1fr; } }
.portal-intro p { color: var(--muted); font-size: 18px; }
.checks { list-style: none; padding: 0; margin: 18px 0 0; }
.checks li { padding-left: 28px; position: relative; margin: 8px 0; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.narrow-card { max-width: 420px; margin: 24px auto; }

.segmented { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 18px; gap: 3px; }
.segmented button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented.wide { max-width: 560px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400; font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%;
}
.form input[type="checkbox"] { width: auto; }
.form input[type="color"] { padding: 4px; height: 44px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form .row { grid-template-columns: 1fr; } }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.form legend { font-weight: 600; font-size: 15px; padding: 0 4px; }
.form .label-text { display: block; }
.form .hint { color: var(--muted); font-weight: 400; font-size: 13px; }
.spec-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.danger { color: #c62828; }
.button:disabled { opacity: .55; cursor: default; }

.store-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.status { display: inline-block; font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; margin: 0 0 18px; }
.status.pending { background: #fff3d6; color: #7a5200; }
.status.live { background: #dcf5e7; color: #136c3a; }
@media (prefers-color-scheme: dark) { .status.pending { background: #3b2e10; color: #ffd98a; } .status.live { background: #12321f; color: #8de0ae; } }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.product-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.product-list li { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--bg); }
.product-list .name { font-weight: 600; }
.product-list .meta { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); margin-left: 6px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

dialog { border: 0; border-radius: 18px; padding: 22px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 12, 16, .45); }
.dialog-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.spacer { flex: 1; }
.photo-preview { display: flex; align-items: center; gap: 12px; }
.photo-preview img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; }

.file-pick { display: inline-flex; flex-direction: column; gap: 8px; font-weight: 600; margin-top: 8px; }
.columns { margin: 12px 0; }
.columns dt { font-family: ui-monospace, Menlo, monospace; font-size: 14px; margin-top: 8px; }
.columns dd { margin: 2px 0 0 0; color: var(--muted); font-size: 14px; }
#import-preview { margin-top: 20px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0 14px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.problem { color: #c62828; white-space: normal; }

.photo-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.photo-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-buttons .button { font-weight: 600; }

/* Elements styled with display must still hide when hidden. */
[hidden] { display: none !important; }

/* The empty-list message spans the whole row instead of the picture column. */
.product-list li.empty { display: block; }
/* Long status text wraps neatly on phones. */
.status { border-radius: 12px; }

.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
dialog.wide-dialog { width: min(980px, calc(100vw - 24px)); }
.scan-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-thumbs figure { margin: 0; position: relative; }
.scan-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; display: block; }
.scan-thumbs button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #333; color: #fff; cursor: pointer; line-height: 24px; padding: 0; }
#scan-table input, #scan-table select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
#scan-table input.title { min-width: 200px; }
#scan-table input.short { width: 110px; }
#scan-table select { min-width: 210px; }
#scan-table input.num { width: 80px; }
#scan-table td { vertical-align: top; }
#scan-table tr.low td { background: rgba(255, 196, 0, 0.12); }
#scan-table tr.error td { background: rgba(220, 40, 40, 0.10); }
#scan-table img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.found-fields { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.form .found-fields label { flex-direction: row; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400; }
.form .found-fields input[type="checkbox"] { margin-top: 3px; flex: none; }
.found-fields .was { display: block; color: var(--muted); font-size: 12px; }
.website-fill { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.website-fill p { margin: 0; }
#scan-table .note { color: var(--muted); font-size: 12px; white-space: normal; min-width: 170px; max-width: 240px; }

.back-link { margin: 4px 0 6px; font-size: 15px; }
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; }
.admin-bar p { margin: 0; }
#admin-store-list li { grid-template-columns: 1fr auto; }
#admin-store-list .status { margin: 0 0 0 6px; font-size: 12px; padding: 2px 8px; }
