:root {
  --ink: #1f1d1a;
  --muted: #6f6a63;
  --line: #ddd8cf;
  --paper: #f6f3ed;
  --panel: #fffdf9;
  --accent: #d84e33;
  --accent-dark: #ad3923;
  --shadow: 0 24px 60px rgba(45, 35, 24, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(216, 78, 51, 0.08), transparent 32rem),
    linear-gradient(rgba(63, 52, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 52, 39, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 28px 28px, 28px 28px, auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid rgba(77, 65, 51, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(30, 113, 67, 0.17);
  border-radius: 999px;
  color: #216a43;
  background: rgba(226, 242, 232, 0.72);
  font-size: 12px;
  font-weight: 600;
}

.local-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ba464;
  box-shadow: 0 0 0 4px rgba(43, 164, 100, 0.12);
}

.topbar-actions,
.view-switcher {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 14px;
}

.view-switcher {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(75, 61, 44, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
}

.view-tab {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.view-tab.active {
  color: #fff;
  background: var(--ink);
}

.view-tab span {
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--ink);
  background: #efe9df;
  font-size: 9px;
  text-align: center;
}

main {
  padding: 82px 0 64px;
}

.hero {
  max-width: 760px;
  margin: 0 auto 44px;
  text-align: center;
}

.eyebrow,
.step-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.hero-copy {
  max-width: 630px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.search-panel {
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgba(75, 61, 44, 0.14);
  border-radius: 26px;
  background: rgba(255, 253, 249, 0.95);
  box-shadow: var(--shadow);
}

.panel-heading,
.sites-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.panel-heading h2,
.sites-heading h2,
.section-heading h2,
.result-panel h2,
.extension-copy h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.shortcut {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #f8f5ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.field-label {
  display: block;
  margin: 30px 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.keyword-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 12px;
}

.input-wrap {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-wrap:focus-within {
  border-color: rgba(216, 78, 51, 0.7);
  box-shadow: 0 0 0 4px rgba(216, 78, 51, 0.09);
}

.input-wrap svg,
.privacy-note svg,
.primary-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.input-wrap svg,
.price-wrap span {
  color: #928a80;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.input-wrap input::placeholder {
  color: #aaa39a;
}

.price-wrap input {
  font-size: 14px;
}

.field-help {
  margin: 8px 0 0;
  color: #918a81;
  font-size: 11px;
}

.sites-heading {
  margin-top: 42px;
}

.select-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.select-actions button,
.text-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.select-actions button:hover,
.text-button:hover {
  color: var(--accent);
}

.select-actions span {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.platform-card {
  position: relative;
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 13px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.platform-card:hover {
  transform: translateY(-2px);
  border-color: #c8c0b6;
  box-shadow: 0 8px 24px rgba(55, 43, 31, 0.07);
}

.platform-card:has(input:focus-visible) {
  outline: 3px solid rgba(216, 78, 51, 0.2);
  outline-offset: 2px;
}

.platform-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--site-color) 48%, #a59c91);
  background: color-mix(in srgb, var(--site-color) 5%, #fff);
}

.platform-card.temporarily-disabled,
.platform-card.temporarily-disabled:hover {
  transform: none;
  border-color: var(--line);
  background: #f3f0eb;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.68;
}

.platform-card.temporarily-disabled .checkmark {
  display: none;
}

.platform-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.site-monogram {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: color-mix(in srgb, var(--site-color) 78%, #17130f);
  background: color-mix(in srgb, var(--site-color) 16%, #f5f2ec);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
}

.site-copy {
  min-width: 0;
}

.site-copy strong,
.site-copy small {
  display: block;
}

.site-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkmark {
  display: grid;
  width: 20px;
  height: 20px;
  margin-left: auto;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #cfc8be;
  border-radius: 6px;
  color: transparent;
  font-size: 12px;
  transition: all 160ms ease;
}

.platform-card:has(input:checked) .checkmark {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.loading-card {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 30px rgba(173, 57, 35, 0.22);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.primary-button:not(:disabled):hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.button-count {
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: #fff;
  font-size: 11px;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 15px 0 0;
  color: #8b847b;
  font-size: 10px;
  text-align: center;
}

.privacy-note svg {
  width: 14px;
  height: 14px;
}

.message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
}

.error-message {
  color: #9b2f21;
  background: #fae9e5;
}

.result-panel {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
  padding: 24px;
  border: 1px solid #cfe1d4;
  border-radius: 18px;
  background: #f4faf5;
}

.result-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2f8a52;
  font-weight: 900;
}

.result-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.result-links a {
  padding: 6px 10px;
  border: 1px solid #cedbd1;
  border-radius: 999px;
  color: #276842;
  background: #fff;
  font-size: 11px;
  text-decoration: none;
}

.recent-section {
  margin-top: 46px;
}

.recent-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: inherit;
  background: rgba(255, 253, 249, 0.75);
  cursor: pointer;
  text-align: left;
}

.recent-item:hover {
  border-color: #bfb6aa;
  background: #fff;
}

.recent-item strong,
.recent-item small {
  display: block;
}

.recent-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.recent-item span:last-child {
  color: var(--accent);
}

.favorites-hero {
  max-width: 830px;
}

.extension-panel,
.manual-panel,
.favorites-section {
  border: 1px solid rgba(75, 61, 44, 0.14);
  border-radius: 22px;
  background: rgba(255, 253, 249, 0.94);
}

.extension-panel {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 22px;
  padding: clamp(24px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.extension-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--accent);
  font-size: 32px;
  line-height: 1;
}

.extension-copy {
  min-width: 0;
}

.extension-copy > p:not(.step-label) {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.extension-copy ol {
  display: grid;
  gap: 7px;
  margin: 20px 0 0;
  padding-left: 19px;
  color: #4e4943;
  font-size: 12px;
  line-height: 1.6;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.extension-copy li code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #f0ece4;
}

.extension-path-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.extension-path-row > code {
  min-width: 0;
  flex: 1;
  padding: 11px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #5f5850;
  background: #f8f5ef;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #cfc7bc;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.manual-panel,
.favorites-section {
  margin-top: 20px;
  padding: clamp(22px, 4vw, 34px);
}

.compact-heading {
  align-items: center;
}

.manual-favorite-form {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) auto;
  gap: 10px;
  margin-top: 17px;
}

.manual-favorite-form .input-wrap {
  min-height: 46px;
  padding: 0 14px;
}

.manual-favorite-form input {
  font-size: 13px;
}

.save-button {
  min-height: 46px;
  padding-inline: 19px;
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.save-button:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.success-message {
  color: #276842;
  background: #eaf5ed;
}

.favorites-heading {
  align-items: center;
}

.favorite-heading-actions,
.scope-switcher,
.layout-switcher {
  display: flex;
  align-items: center;
}

.favorite-heading-actions {
  gap: 10px;
}

.scope-switcher,
.layout-switcher {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f6f2eb;
}

.scope-button,
.layout-button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.scope-button.active,
.layout-button.active {
  color: #fff;
  background: var(--ink);
}

.scope-button span {
  margin-left: 3px;
  opacity: 0.72;
}

.total-label {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #f1ede6;
  font-size: 11px;
}

.favorite-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 2fr) repeat(5, minmax(108px, 1fr)) auto;
  gap: 10px;
  margin-top: 20px;
}

.refresh-control-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dfd7cd;
  border-radius: 18px;
  background: linear-gradient(135deg, #fffdf9, #f7f3ed);
}

.refresh-control-heading,
.auto-refresh-settings,
.batch-progress-heading,
.batch-progress-counts {
  display: flex;
  align-items: center;
}

.refresh-control-heading {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
}

.refresh-control-heading > div:first-child {
  min-width: 0;
}

.refresh-control-actions {
  display: flex;
  max-width: 100%;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.refresh-control-heading h3 {
  margin: 3px 0 5px;
  font-family: var(--display);
  font-size: 20px;
}

.refresh-control-heading > div > p:last-child,
.auto-refresh-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.refresh-extension-state {
  max-width: 100%;
  flex: 0 1 auto;
  padding: 7px 10px;
  overflow-wrap: anywhere;
  border-radius: 999px;
  color: #7b7067;
  background: #eee8df;
  font-size: 10px;
  font-weight: 800;
}

.refresh-extension-state.connected {
  color: #246b43;
  background: #e4f2e8;
}

.refresh-extension-state.disconnected {
  color: #9b4938;
  background: #f8e5e0;
}

.auto-refresh-settings {
  flex-wrap: wrap;
  gap: 12px;
}

.auto-refresh-toggle,
.auto-refresh-interval,
.refresh-concurrency-setting {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.auto-refresh-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.auto-refresh-interval,
.refresh-concurrency-setting {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.auto-refresh-interval input,
.refresh-concurrency-setting select {
  width: 76px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.refresh-concurrency-setting select {
  width: auto;
  min-width: 136px;
  cursor: pointer;
}

.auto-refresh-save,
.bulk-refresh,
.refresh-all-favorites {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #c95d48;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.auto-refresh-save:hover:not(:disabled),
.bulk-refresh:hover:not(:disabled),
.refresh-all-favorites:hover:not(:disabled) {
  border-color: #a8402e;
  background: #bd4934;
}

.auto-refresh-save:disabled,
.bulk-refresh:disabled,
.refresh-all-favorites:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.auto-refresh-feedback {
  color: #287649;
  font-size: 10px;
}

.batch-refresh-progress {
  display: grid;
  min-width: 0;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid #e3dad0;
}

.batch-refresh-progress[hidden] {
  display: none;
}

.batch-progress-heading {
  min-width: 0;
  justify-content: space-between;
  gap: 14px;
  font-size: 11px;
}

.batch-progress-heading strong {
  flex: 0 0 auto;
}

.batch-progress-heading span {
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-refresh-progress progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: var(--accent);
  background: #e8e1d8;
  accent-color: var(--accent);
}

.batch-refresh-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e8e1d8;
}

.batch-refresh-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.batch-refresh-verify {
  width: fit-content;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #b65c18;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.batch-refresh-verify[hidden] {
  display: none;
}

.batch-progress-counts {
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 10px;
}

.batch-progress-counts .success {
  color: #287649;
}

.batch-progress-counts .changed {
  color: #8a5a13;
}

.batch-progress-counts .skipped,
.batch-refresh-skips {
  color: #766d64;
}

.batch-progress-counts .failed,
.batch-refresh-errors {
  color: #a14332;
}

.refresh-debug-panel {
  padding-top: 12px;
  border-top: 1px solid #e3dad0;
  color: var(--muted);
  font-size: 10px;
}

.refresh-debug-panel > summary {
  width: fit-content;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.refresh-debug-heading,
.refresh-log-entry-heading,
.drawer-refresh-actions {
  display: flex;
  align-items: center;
}

.refresh-debug-heading {
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.refresh-debug-heading p,
.refresh-log-entry p,
.refresh-log-empty {
  margin: 0;
}

#refresh-log-reload,
#drawer-refresh-compat {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.refresh-log-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.refresh-log-entry {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-left: 3px solid #b9afa5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.refresh-log-entry.success { border-left-color: #3f9360; }
.refresh-log-entry.warning { border-left-color: #bd8728; }
.refresh-log-entry.error { border-left-color: #c24c38; }

.refresh-log-entry-heading {
  justify-content: space-between;
  gap: 10px;
}

.refresh-log-entry-heading strong { color: var(--ink); }

.refresh-log-entry details summary { cursor: pointer; }

.refresh-log-entry pre {
  max-height: 180px;
  margin: 6px 0 0;
  padding: 8px;
  overflow: auto;
  border-radius: 7px;
  background: #f2ede6;
  color: #4f4740;
  font-size: 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.drawer-refresh-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.batch-refresh-skips {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 10px;
}

.batch-refresh-change-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e1d5bf;
  border-radius: 12px;
  background: #fffaf0;
  color: #574d43;
  font-size: 11px;
}

.batch-refresh-change-panel[hidden] {
  display: none;
}

.batch-refresh-change-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.batch-refresh-change-heading strong {
  color: var(--ink);
  font-size: 12px;
}

.batch-refresh-change-heading span {
  color: #875e18;
  font-size: 10px;
  font-weight: 800;
}

.batch-refresh-changes {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.batch-change-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(127, 103, 76, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(67, 50, 31, 0.045);
}

.batch-change-image {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--site-color) 10%, #f5f1ea), #f8f5ef);
}

.batch-change-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.batch-change-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  color: color-mix(in srgb, var(--site-color) 76%, #17130f);
  background: color-mix(in srgb, var(--site-color) 14%, #f5f2ec);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
}

.batch-change-content {
  min-width: 0;
}

.batch-change-meta,
.batch-change-facts,
.batch-change-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.batch-change-meta {
  gap: 6px 10px;
  color: var(--muted);
  font-size: 9px;
}

.batch-change-meta span:first-child {
  color: color-mix(in srgb, var(--site-color) 75%, #39322b);
  font-weight: 800;
}

.batch-change-content h4 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.batch-change-facts {
  gap: 7px;
  margin-top: 8px;
}

.batch-change-facts strong {
  color: var(--ink);
  font-size: 12px;
}

.batch-change-details {
  display: grid;
  gap: 4px;
  margin: 9px 0 0;
  padding: 8px 10px 8px 25px;
  border-radius: 8px;
  background: #f8f4ed;
  line-height: 1.55;
}

.batch-change-actions {
  gap: 7px;
  margin-top: 9px;
}

.batch-change-actions button,
.batch-change-actions a {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #51483f;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  line-height: 28px;
  text-decoration: none;
}

.batch-change-actions button:hover,
.batch-change-actions a:hover {
  border-color: #c7b9aa;
  color: var(--accent);
}

.batch-change-actions button:focus-visible,
.batch-change-actions a:focus-visible {
  outline: 3px solid rgba(216, 78, 51, 0.2);
  outline-offset: 2px;
}

.batch-change-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.batch-refresh-changes li,
.drawer-refresh-changes li {
  overflow-wrap: anywhere;
}

.batch-refresh-changes .down,
.drawer-refresh-changes .down {
  color: #287649;
}

.batch-refresh-changes .up,
.drawer-refresh-changes .up {
  color: #a14332;
}

.batch-refresh-errors {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 10px;
}

.favorite-bulk-toggle,
.bulk-delete,
.bulk-exit {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.favorite-bulk-toggle:hover,
.bulk-exit:hover {
  color: var(--accent);
  border-color: #e1b0a6;
  background: #fff8f6;
}

.favorite-bulk-toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 8px 10px 8px 14px;
  border: 1px solid #e7d7cf;
  border-radius: 14px;
  background: #fff9f6;
}

.bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.bulk-select-all input,
.favorite-select-control input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.bulk-selected-label {
  color: var(--muted);
  font-size: 11px;
}

.bulk-selected-label strong {
  color: var(--ink);
}

.bulk-feedback {
  flex: 1;
  color: #9b4938;
  font-size: 10px;
}

.bulk-toolbar-actions {
  display: flex;
  gap: 8px;
}

.bulk-delete {
  color: #fff;
  border-color: #a33d2d;
  background: #a33d2d;
}

.bulk-delete:hover:not(:disabled),
.bulk-delete.confirming {
  border-color: #7c271d;
  background: #7c271d;
}

.bulk-delete:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.favorite-search-wrap {
  min-height: 48px;
}

.favorite-toolbar select {
  min-height: 48px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.favorite-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.favorite-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.favorite-select-control {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(91, 75, 61, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 15px rgba(45, 36, 27, 0.1);
  cursor: pointer;
}

.favorite-list.bulk-mode .favorite-select-control {
  display: grid;
}

.favorite-list.bulk-mode .favorite-card {
  cursor: pointer;
}

.favorite-list.bulk-mode .favorite-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}

.favorite-list.bulk-mode .favorite-actions {
  visibility: hidden;
}

.favorite-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--site-color) 42%, #b9b1a7);
  box-shadow: 0 12px 28px rgba(50, 39, 27, 0.09);
}

.favorite-image-wrap {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--site-color) 10%, #f5f1ea), #f8f5ef);
}

.favorite-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorite-mark {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border-radius: 18px;
  color: color-mix(in srgb, var(--site-color) 76%, #17130f);
  background: color-mix(in srgb, var(--site-color) 14%, #f5f2ec);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  font-weight: 900;
}

.favorite-card-copy {
  min-width: 0;
  flex: 1;
  padding: 16px 16px 10px;
}

.favorite-meta {
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 9px;
}

.favorite-meta span {
  color: color-mix(in srgb, var(--site-color) 75%, #39322b);
  font-weight: 800;
}

.favorite-card h3 {
  display: -webkit-box;
  min-height: 42px;
  margin: 8px 0 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.favorite-snapshot,
.favorite-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.favorite-snapshot {
  margin-top: 13px;
}

.favorite-snapshot strong {
  margin-right: 3px;
  font-size: 16px;
}

.snapshot-badge,
.condition-badge,
.status-badge,
.priority-badge,
.favorite-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  color: #6d665e;
  background: #f2eee7;
  font-size: 9px;
  font-weight: 700;
}

.favorite-refresh-meta {
  min-height: 15px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

.favorite-refresh-meta.pending,
.favorite-refresh-meta.verification {
  color: #875e18;
  font-weight: 700;
}

.favorite-refresh-meta.failed {
  color: #a03d30;
  font-weight: 700;
}

.favorite-refresh-meta.success {
  color: #287649;
}

.favorite-change-summary {
  margin: 4px 0 0;
  color: #875e18;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
}

.snapshot-badge.available {
  color: #216a43;
  background: #e4f3e8;
}

.snapshot-badge.preorder {
  color: #8a5a0a;
  background: #fff2d5;
}

.snapshot-badge.unavailable {
  color: #8c3a30;
  background: #f8e7e3;
}

.condition-badge.new,
.condition-badge.like_new {
  color: #3a5f37;
  background: #e9f2e5;
}

.condition-badge.good {
  color: #3f5f73;
  background: #e7f0f5;
}

.condition-badge.used {
  color: #62584d;
  background: #eee9e2;
}

.condition-badge.fair {
  color: #805d1d;
  background: #f7eed8;
}

.condition-badge.poor {
  color: #8c3a30;
  background: #f8e7e3;
}

.condition-badge {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge.want {
  color: #99402c;
  background: #f9e8e4;
}

.status-badge.watching {
  color: #765316;
  background: #f7eed8;
}

.priority-badge.high {
  color: #a02f20;
  border: 1px solid #ebbbb2;
  background: #fff;
}

.favorite-tags {
  min-height: 21px;
  margin-top: 9px;
}

.favorite-tags span {
  color: #665d91;
  background: #f0edf8;
}

.favorite-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 16px;
}

.favorite-actions a,
.favorite-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 32px;
  text-decoration: none;
}

.favorite-actions a:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.favorite-actions button {
  color: var(--ink);
}

.favorite-actions button:hover {
  color: var(--accent);
  border-color: #e3b3aa;
  background: #fff8f6;
}

.favorite-actions button.refresh-action {
  margin-right: auto;
}

.favorite-actions button.refresh-action[disabled] {
  cursor: wait;
  opacity: 0.62;
}

.favorite-list.list-mode {
  grid-template-columns: 1fr;
}

.favorite-list.list-mode .favorite-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
}

.favorite-list.list-mode .favorite-image-wrap {
  width: 110px;
  height: 100%;
  min-height: 118px;
  aspect-ratio: auto;
}

.favorite-list.list-mode .favorite-mark {
  width: 52px;
  height: 52px;
}

.favorite-list.list-mode .favorite-card-copy {
  padding: 16px;
}

.favorite-list.list-mode .favorite-card h3 {
  min-height: 0;
  -webkit-line-clamp: 1;
}

.favorite-list.list-mode .favorite-actions {
  padding: 16px;
}

.favorite-empty {
  padding: 52px 20px 34px;
  color: var(--muted);
  text-align: center;
}

.favorite-empty > span {
  display: block;
  color: #c7beb2;
  font-size: 50px;
  line-height: 1;
}

.favorite-empty h3 {
  margin: 13px 0 0;
  color: var(--ink);
  font-size: 16px;
}

.favorite-empty p {
  margin: 7px 0 0;
  font-size: 11px;
}

body.drawer-open {
  overflow: hidden;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  background: rgba(31, 29, 26, 0.34);
  backdrop-filter: blur(4px);
}

.favorite-drawer {
  width: min(500px, 100%);
  height: 100%;
  padding: 26px;
  overflow-y: auto;
  background: var(--panel);
  box-shadow: -24px 0 60px rgba(30, 24, 18, 0.2);
}

.drawer-header,
.drawer-meta-row,
.drawer-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header {
  margin-bottom: 22px;
}

.drawer-header .step-label {
  margin-bottom: 3px;
}

#drawer-save-state {
  color: var(--muted);
  font-size: 10px;
}

.drawer-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.drawer-image-wrap {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  color: #a39b90;
  background: #f2eee7;
  font-size: 12px;
}

.drawer-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.drawer-product-copy {
  padding: 22px 2px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-platform {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.drawer-product-copy h2 {
  margin: 12px 0 0;
  font-size: 23px;
  line-height: 1.38;
}

.drawer-price-row {
  justify-content: flex-start;
  margin-top: 14px;
}

.drawer-price-row strong {
  font-size: 22px;
}

.drawer-price-row span {
  color: var(--muted);
  font-size: 10px;
}

.drawer-open-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.drawer-refresh-panel {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf7f2;
}

.drawer-refresh-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drawer-refresh-heading-row h3 {
  margin: 0;
  font-size: 13px;
}

#drawer-refresh-state {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

#drawer-refresh-state.pending,
#drawer-refresh-state.verification {
  color: #875e18;
}

#drawer-refresh-state.failed {
  color: #a03d30;
}

#drawer-refresh-state.success {
  color: #287649;
}

#drawer-refresh {
  min-width: 88px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

#drawer-refresh[disabled] {
  cursor: wait;
  opacity: 0.58;
}

.drawer-refresh-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 15px 0 0;
}

.drawer-refresh-times div {
  min-width: 0;
}

.drawer-refresh-times dt {
  color: var(--muted);
  font-size: 9px;
}

.drawer-refresh-times dd {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-refresh-changes {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: #574d43;
  font-size: 10px;
}

.drawer-refresh-changes[hidden] {
  display: none;
}

.drawer-change-history-heading,
.drawer-change-history-entry-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-change-history-heading strong {
  color: #875e18;
  font-size: 11px;
}

.drawer-change-history-heading span,
.drawer-change-history-entry-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.drawer-change-history-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.drawer-change-history-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawer-change-history-entry {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid #e8ddcc;
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.86);
}

.drawer-change-history-entry-heading time {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.drawer-change-history-entry ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.drawer-form {
  display: grid;
  gap: 18px;
  padding-top: 24px;
}

.drawer-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.drawer-form label {
  display: grid;
  gap: 7px;
  color: #4d4740;
  font-size: 11px;
  font-weight: 700;
}

.drawer-form input,
.drawer-form select,
.drawer-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 13px;
}

.drawer-form input,
.drawer-form select {
  min-height: 44px;
  padding: 0 12px;
}

.drawer-form textarea {
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

.drawer-form input:focus,
.drawer-form select:focus,
.drawer-form textarea:focus {
  border-color: rgba(216, 78, 51, 0.65);
  box-shadow: 0 0 0 3px rgba(216, 78, 51, 0.08);
}

.drawer-delete {
  margin-top: 26px;
  padding: 0;
  border: 0;
  color: #9b5044;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 38px;
  border-top: 1px solid rgba(77, 65, 51, 0.12);
  color: #928a80;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[hidden] {
  display: none !important;
}

.monitor-create-panel,
.monitor-email-panel,
.monitor-section,
.monitor-progress {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
}

.monitor-email-panel {
  margin-top: 26px;
}

.monitor-email-panel form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.monitor-email-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.monitor-email-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.monitor-email-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.monitor-email-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.monitor-email-grid input,
.monitor-email-grid select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 11px;
}

.monitor-email-password-field {
  grid-column: span 2;
}

.monitor-email-note {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.monitor-email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.monitor-email-actions .primary-button,
.monitor-email-actions .secondary-button {
  width: auto;
  min-height: 42px;
  margin: 0;
  padding: 0 18px;
}

.monitor-create-panel form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.monitor-field-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, .8fr) minmax(150px, .7fr);
  gap: 12px;
}

.monitor-field-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.monitor-field-grid input {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.monitor-interval-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-interval-input input {
  width: 100%;
}

.monitor-sites-heading {
  margin-top: 4px;
}

.monitor-progress {
  display: grid;
  gap: 10px;
  color: var(--muted);
  background: #fffaf0;
}

.monitor-progress[hidden] {
  display: none;
}

.monitor-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.monitor-progress strong {
  color: var(--ink);
}

.monitor-progress progress {
  width: 100%;
  accent-color: var(--accent);
}

.monitor-progress p {
  margin: 0;
  font-size: 10px;
}

.monitor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.monitor-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.monitor-card-heading,
.monitor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.monitor-card-heading p,
.monitor-card h3,
.monitor-status,
.monitor-counts {
  margin: 0;
}

.monitor-card-settings {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.monitor-card-settings input {
  width: 64px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.monitor-card-settings button {
  min-height: 32px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
}

.monitor-card-heading p {
  color: var(--muted);
  font-size: 9px;
}

.monitor-card h3 {
  margin-top: 4px;
  font-size: 15px;
}

.monitor-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #246b43;
  background: #e4f2e8;
  font-size: 9px;
  font-weight: 800;
}

.monitor-state.paused {
  color: #746a61;
  background: #eee9e2;
}

.monitor-status,
.monitor-counts {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.monitor-status.failed,
.monitor-status.partial {
  color: #a14332;
}

.monitor-status.queued {
  color: #9a5b1c;
}

.monitor-platform-states {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.monitor-platform-state {
  padding: 4px 7px;
  border-radius: 999px;
  color: #766d64;
  background: #f1ede7;
  font-size: 8px;
  font-weight: 750;
}

.monitor-platform-state.ready {
  color: #276b44;
  background: #e5f2e9;
}

.monitor-platform-state.failed {
  color: #a14332;
  background: #f8e5e0;
}

.monitor-platform-state.skipped {
  color: #766d64;
  background: #eee9e1;
}

.monitor-actions {
  justify-content: flex-start;
}

.monitor-actions button,
#monitor-mark-read {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
}

.monitor-actions button:hover:not(:disabled) {
  color: var(--accent);
  border-color: #e3b3aa;
}

.monitor-actions button.danger {
  margin-left: auto;
  color: #a14332;
}

.monitor-actions button:disabled,
#monitor-mark-read:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.monitor-manual-note {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.monitor-item-list {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.monitor-log-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-log-actions .text-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
}

.monitor-log-intro {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.monitor-log-list {
  display: grid;
  gap: 0;
  max-height: 420px;
  margin-top: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.monitor-log-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid #eee8e0;
}

.monitor-log-row:last-child {
  border-bottom: 0;
}

.monitor-log-marker {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #70675f;
  background: #f0ece6;
  font-size: 9px;
  font-weight: 900;
}

.monitor-log-row.success .monitor-log-marker {
  color: #246b43;
  background: #e4f2e8;
}

.monitor-log-row.warning .monitor-log-marker,
.monitor-log-row.error .monitor-log-marker {
  color: #a14332;
  background: #f8e5e0;
}

.monitor-log-row p {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.55;
}

.monitor-log-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.monitor-item-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.monitor-item-card.unread {
  border-color: #e2a897;
  box-shadow: inset 3px 0 var(--accent);
}

.monitor-item-card.read {
  opacity: .72;
}

.monitor-item-card img,
.monitor-item-mark {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 10px;
  background: #f2eee7;
}

.monitor-item-mark {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.monitor-item-card p,
.monitor-item-card h3 {
  margin: 0;
}

.monitor-item-card p {
  color: var(--muted);
  font-size: 9px;
}

.monitor-item-times {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 5px;
  color: #776e65;
  font-size: 9px;
  line-height: 1.45;
}

.monitor-item-times time + time {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.monitor-item-card h3 {
  margin: 5px 0 8px;
  font-size: 13px;
}

.monitor-item-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
}

.monitor-item-condition {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #5f574f;
  background: #f1ede7;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.4;
}

.monitor-item-condition:not(.condition-unknown) {
  color: #276f4b;
  background: #e5f3e9;
}

.monitor-item-card a {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1020px) {
  .favorite-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .favorite-search-wrap {
    grid-column: span 2;
  }

  .favorite-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100% - 24px, 680px);
  }

  main {
    padding-top: 58px;
  }

  .keyword-row,
  .platform-grid,
  .recent-list,
  .manual-favorite-form,
  .monitor-field-grid,
  .monitor-email-grid,
  .monitor-list {
    grid-template-columns: 1fr;
  }

  .monitor-email-password-field {
    grid-column: auto;
  }

  .monitor-item-card {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .monitor-item-card img,
  .monitor-item-mark {
    width: 68px;
    height: 68px;
  }

  .monitor-item-card a {
    grid-column: 2;
  }

  .local-badge {
    display: none;
  }

  .search-panel {
    border-radius: 20px;
  }

  .favorites-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .favorite-heading-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  .shortcut {
    display: none;
  }

  .topbar {
    min-height: 72px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-copy {
    font-size: 14px;
  }

  .panel-heading,
  .sites-heading,
  .section-heading,
  footer {
    align-items: flex-start;
  }

  .brand small,
  .view-tab:first-child {
    display: none;
  }

  .view-tab {
    padding-inline: 10px;
  }

  .search-panel {
    padding: 24px 18px;
  }

  .result-panel {
    grid-template-columns: 1fr;
  }

  .extension-panel,
  .favorite-card {
    grid-template-columns: 1fr;
  }

  .extension-icon {
    width: 52px;
    height: 52px;
  }

  .extension-path-row,
  .favorite-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .favorite-toolbar {
    grid-template-columns: 1fr;
  }

  .favorite-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .refresh-control-heading,
  .auto-refresh-settings,
  .batch-progress-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-extension-state {
    align-self: flex-start;
  }

  .refresh-control-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .refresh-all-favorites {
    width: 100%;
  }

  .auto-refresh-interval,
  .refresh-concurrency-setting {
    padding-left: 0;
    border-left: 0;
  }

  .auto-refresh-save {
    width: 100%;
  }

  .batch-progress-counts {
    width: 100%;
  }

  .batch-progress-heading span {
    width: 100%;
    max-width: 100%;
  }

  .batch-refresh-change-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .batch-change-card {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .batch-change-image {
    width: 68px;
    height: 68px;
  }

  .refresh-debug-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #refresh-log-reload {
    width: 100%;
  }

  .bulk-feedback {
    min-height: 14px;
  }

  .bulk-toolbar-actions {
    width: 100%;
  }

  .bulk-toolbar-actions button {
    flex: 1;
  }

  .favorite-search-wrap {
    grid-column: auto;
  }

  .favorite-list {
    grid-template-columns: 1fr;
  }

  .favorite-list.list-mode .favorite-card {
    display: flex;
  }

  .favorite-list.list-mode .favorite-image-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .favorite-drawer {
    padding: 20px;
  }

  .drawer-field-row {
    grid-template-columns: 1fr;
  }

  .drawer-refresh-times {
    grid-template-columns: 1fr;
  }

  .favorite-actions a,
  .favorite-actions button {
    text-align: center;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* Coverage is separate from baseline readiness and remains readable after a run. */
.monitor-coverage-list { margin: 12px 0; padding-left: 20px; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.monitor-coverage-list:empty { display: none; }
.monitor-coverage-list .covered { color: #506854; }
.monitor-coverage-list .incomplete { color: #a93e2b; }
