:root {
  color-scheme: light;
  --ink: #202a2a;
  --muted: #6c7878;
  --line: #e3e8e5;
  --green: #23795b;
  --bg: #f5f7f5;
  --warning: #85601d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
a {
  color: var(--green);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #8fc9af;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.7px;
  line-height: 1.3;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.4px;
  line-height: 1.35;
}
h3 {
  font-size: 17px;
  line-height: 1.4;
}
small {
  font-size: 12px;
}
button {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.app-header {
  max-width: 1000px;
  margin: auto;
  padding: 23px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.brand {
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.brand:hover {
  text-decoration: none;
}
.brand > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 23px;
  font-weight: 400;
}
.connection {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 7px;
  align-items: center;
}
.connection:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a5afac;
}
.connection.live:before {
  background: #42a176;
}
.connection.off {
  color: #a85b4e;
}
main {
  max-width: 1000px;
  padding: 30px 28px 0;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 27px;
}
.page-heading p {
  color: var(--muted);
  font-size: 14px;
  max-width: 540px;
  margin-top: 9px;
}
.button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 16px;
  min-height: 42px;
  font-size: 14px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  line-height: 1.4;
}
.primary {
  background: var(--green);
  color: white;
}
.primary:hover {
  background: #196448;
}
.secondary {
  background: white;
  border-color: #dce3df;
}
.secondary:hover {
  border-color: #b8c9c0;
  background: #f8faf9;
}
.danger {
  border-color: #ecd7d2;
  background: #fff;
  color: #ad5b4d;
}
.small-button {
  padding: 7px 12px;
  min-height: 35px;
  font-size: 13px;
}
.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tabs button {
  background: none;
  border: 0;
  padding: 12px 0;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active {
  border-bottom-color: var(--green);
  color: var(--ink);
  font-weight: 650;
}
.tabs span {
  font-size: 11px;
  background: #e8ede9;
  color: #66766d;
  min-width: 19px;
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 5px;
}
.tabs button.active span {
  background: #e1eee6;
  color: #397157;
}
.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.filter-group {
  display: flex;
  gap: 5px;
}
.filter-group button {
  border: 1px solid transparent;
  background: none;
  border-radius: 7px;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
}
.filter-group button.active {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}
.list-count {
  color: var(--muted);
  font-size: 13px;
}
.watch-list {
  display: grid;
  gap: 15px;
}
.watch-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 13px;
  padding: 22px 24px;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
}
.card-title {
  min-width: 0;
}
.card-title h3 {
  overflow-wrap: anywhere;
}
.card-title small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.watch-criteria {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f8f6;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.watch-criteria ul { list-style: none; margin: 0; padding: 0; }
.watch-criteria li + li { margin-top: 4px; }
.watch-criteria .watch-alias { margin: 0; color: var(--muted); }
.watch-criteria .watch-alias + ul, .watch-criteria .watch-alias + p { margin-top: 5px; }
.status-pill {
  display: inline-block;
  max-width: 250px;
  border-radius: 6px;
  padding: 4px 8px;
  background: #edf5f0;
  color: #3a785b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.status-pill.warning {
  background: #fcf4e5;
  color: var(--warning);
}
.status-pill.neutral {
  background: #f0f3f1;
  color: #7b8580;
}
.prices {
  display: flex;
  align-items: flex-start;
  gap: 60px;
  margin: 24px 0 18px;
}
.price-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.current-price {
  font-size: 29px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.8px;
}
.current-price small {
  font-size: 13px;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
}
.current-price.unknown {
  font-size: 18px;
  font-weight: 500;
  color: #77827d;
  letter-spacing: 0;
  padding: 5px 0;
}
.current-price.good {
  color: var(--green);
}
.target-price {
  font-size: 19px;
  line-height: 1.8;
  color: #637269;
  font-weight: 450;
  letter-spacing: -0.3px;
}
.target-price small {
  font-size: 12px;
  color: #7e8983;
}
.checked-at {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.card-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--warning);
  background: #fffaf0;
  padding: 10px 12px;
  border-radius: 7px;
  margin-bottom: 17px;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #eff2f0;
  padding-top: 16px;
}
.card-actions .details-button {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 13px;
  padding: 7px 0;
}
.empty {
  padding: 45px 24px;
  text-align: center;
  border: 1px dashed #d5dfd9;
  background: #fff9;
  border-radius: 13px;
}
.empty h2 {
  font-size: 20px;
}
.empty p {
  color: var(--muted);
  font-size: 14px;
  max-width: 430px;
  margin: 10px auto 22px;
}
.empty-simple {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  padding: 18px 0;
}
.notice {
  border: 1px solid #e2e8e2;
  border-radius: 8px;
  background: #f4f7f4;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
  color: #5e7166;
}
.notice.warning {
  background: #fffbf2;
  border-color: #efe1c5;
  color: var(--warning);
}
.notice.error {
  background: #fff5f2;
  border-color: #f0d5ce;
  color: #a65548;
}
.notice strong {
  display: block;
  color: inherit;
  font-weight: 650;
  margin-bottom: 4px;
}
.notice .button {
  margin-top: 10px;
  margin-right: 6px;
}
.notice p + p {
  margin-top: 7px;
}
.link-button {
  color: var(--green);
  border: 0;
  padding: 0;
  background: none;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
footer {
  font-size: 12px;
  color: #88938b;
  margin: 30px 0;
  padding-bottom: 25px;
  max-width: 720px;
}
.dialog {
  color: var(--ink);
  padding: 26px;
  width: min(530px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 15px;
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 25px 100px #1e3b2526;
}
.dialog::backdrop {
  background: #182c244d;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 23px;
}
.close {
  background: none;
  border: 0;
  padding: 0 2px;
  color: #7d8983;
  font-size: 26px;
  line-height: 1;
}
.mode-tabs {
  display: flex;
  padding: 4px;
  background: #eff3f0;
  border-radius: 8px;
  margin-bottom: 22px;
  gap: 4px;
}
.mode-tabs button {
  flex: 1;
  padding: 8px 7px;
  border: 0;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  color: #728078;
}
.mode-tabs button.active {
  background: white;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px #243d2808;
}
.field {
  display: block;
  margin: 17px 0;
}
.field > span {
  display: block;
  font-weight: 550;
  font-size: 13px;
  margin-bottom: 7px;
}
.field input,
.field select {
  width: 100%;
  border: 1px solid #d9e2dc;
  background: #fff;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  font-size: 14px;
  min-height: 44px;
}
.field input:focus,
.field select:focus {
  border-color: #70ad8e;
  box-shadow: 0 0 0 3px #3f9c6810;
}
.field input:disabled {
  background: #f6f8f6;
  color: #7c8980;
}
.field input::placeholder {
  color: #a0aaa4;
}
.field small {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.5;
}
.input-suffix {
  position: relative;
}
.input-suffix input {
  padding-right: 55px;
}
.input-suffix b {
  position: absolute;
  right: 13px;
  top: 12px;
  color: #89968c;
  font-size: 13px;
  font-weight: 500;
}
.price-input input {
  font-size: 20px;
  min-height: 50px;
}
.price-input b {
  top: 15px;
}
.checkbox-row {
  display: flex;
  gap: 24px;
  font-size: 14px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 18px 0;
}
legend {
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 8px;
}
.check {
  font-size: 13px;
  line-height: 1.6;
  color: #647267;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 13px 0;
}
.check input,
.checkbox-row input {
  accent-color: var(--green);
  margin-top: 4px;
}
.hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 10px 0;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 21px;
}
summary {
  font-size: 13px;
  color: #62766a;
  cursor: pointer;
  list-style-position: inside;
  padding: 3px 0;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  margin-top: 23px;
  padding-top: 20px;
}
.detail-dialog {
  width: min(780px, calc(100vw - 28px));
}
.detail-prices {
  padding: 0 0 19px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 17px;
}
.detail-prices .prices {
  margin: 0 0 18px;
}
.detail-prices .card-actions {
  border: 0;
  padding: 0;
}
.detail-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}
.detail-section-title {
  font-size: 15px;
  font-weight: 650;
  margin: 23px 0 8px;
}
.offer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.offer h3 {
  font-size: 14px;
  line-height: 1.5;
}
.offer p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 6px;
}
.offer-price {
  text-align: right;
  white-space: nowrap;
  min-width: 100px;
  font-size: 17px;
  font-weight: 650;
}
.offer-price small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
  margin-top: 3px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  border-radius: 4px;
  background: #f1f4f1;
  color: #78847c;
  padding: 2px 5px;
  margin-left: 5px;
}
.badge.good {
  background: #edf6ef;
  color: #4e815e;
}
.badge.warning {
  background: #fff4e0;
  color: #a18043;
}
.chart svg {
  display: block;
  width: 100%;
  height: 150px;
  margin-top: 9px;
  overflow: visible;
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.source-list {
  display: grid;
  gap: 13px;
}
.source-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 21px 23px;
}
.source-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.source-card p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 12px;
}
.source-card .source-error {
  color: var(--warning);
}
.notification {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 20px 23px;
  margin-bottom: 12px;
}
.notification.unread {
  border-left: 3px solid var(--green);
}
.notification h3 {
  font-size: 15px;
}
.notification p {
  font-size: 14px;
  margin-top: 8px;
}
.notification small {
  display: block;
  color: var(--muted);
  margin-top: 12px;
}
.notification-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
}
.toast {
  position: fixed;
  bottom: 23px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 12px 20px;
  border-radius: 9px;
  background: #283a30;
  color: white;
  box-shadow: 0 5px 20px #1a302626;
  font-size: 13px;
  max-width: calc(100vw - 28px);
}
@media (max-width: 650px) {
  .app-header {
    padding: 20px;
  }
  .brand {
    font-size: 18px;
  }
  .connection {
    font-size: 11px;
  }
  main {
    padding: 20px 20px 0;
  }
  .page-heading {
    display: block;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 27px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .page-heading > .button {
    width: 100%;
    margin-top: 19px;
  }
  .tabs {
    gap: 20px;
    margin-bottom: 20px;
  }
  .tabs button {
    font-size: 13px;
  }
  .watch-card {
    padding: 19px 17px;
  }
  .card-heading {
    display: block;
  }
  .status-pill {
    margin-top: 10px;
    max-width: 100%;
  }
  .card-title h3 {
    font-size: 16px;
  }
  .prices {
    gap: 28px;
    justify-content: space-between;
    margin: 19px 0;
  }
  .prices > div {
    flex: 1;
    min-width: 0;
  }
  .current-price {
    font-size: 27px;
  }
  .current-price.unknown {
    font-size: 17px;
  }
  .target-price {
    font-size: 18px;
  }
  .price-label {
    font-size: 11px;
  }
  .card-actions {
    gap: 6px;
  }
  .card-actions .button {
    font-size: 12px;
    padding: 7px 10px;
  }
  .card-actions .details-button {
    margin-left: 0;
    width: 100%;
    text-align: left;
    padding-top: 9px;
  }
  .dialog {
    padding: 23px 19px;
  }
  .dialog h2 {
    font-size: 20px;
  }
  .detail-prices .prices {
    gap: 20px;
  }
  .offer {
    gap: 10px;
  }
  .offer-price {
    font-size: 15px;
    min-width: 85px;
  }
  .source-card {
    padding: 19px 17px;
  }
  .source-card header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
  }
  .source-card .status-pill {
    margin-top: 0;
  }
  .notice .button {
    white-space: normal;
    text-align: left;
    font-size: 12px;
  }
  .list-count {
    font-size: 12px;
  }
  .filter-group button {
    padding: 5px 7px;
    font-size: 12px;
  }
  .chart-axis {
    font-size: 10px;
  }
  .dialog-actions .button {
    font-size: 13px;
  }
  .notification-bar {
    font-size: 12px;
  }
  .notification {
    padding: 18px;
  }
  .notification p {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .button {
    transition:
      background 0.12s,
      border-color 0.12s;
  }
}

.schedule-note {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 16px;
}
.dialog-actions { flex-wrap: wrap; }
.offer > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.current-price, .target-price { overflow-wrap: anywhere; }
@media (max-width: 380px) {
  .app-header { align-items: flex-start; gap: 10px; }
  .connection { max-width: 125px; }
  .connection:before { flex-shrink: 0; margin-top: 5px; }
  .prices { gap: 15px; }
  .current-price { font-size: 24px; }
  .dialog-actions > .button { flex: 1; }
  .detail-dialog .dialog-actions > .button { flex-basis: 100%; }
}

.source-comparison {display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 12px;font-size:13px;line-height:1.45;}
.source-quote {padding:6px 9px;border:1px solid #e3e7ed;border-radius:8px;color:#626c7a;text-decoration:none;}
a.source-quote:hover {text-decoration:underline;}
.source-quote.lowest {color:#176844;background:#eef8f2;border-color:#c9e6d5;}

#ai-fields { margin: 16px 0; padding: 14px; border: 1px solid #dbe5df; border-radius: 12px; }
#ai-fields[hidden] { display: none; }
#ai-fields textarea { width: 100%; min-height: 72px; padding: 10px; border: 1px solid #c9d6cd; border-radius: 8px; font: inherit; resize: vertical; box-sizing: border-box; }
.requirement-evidence { overflow-wrap: anywhere; }
.requirement-evidence q { color: #526b5a; }
