:root {
  --ink: #17372f;
  --ink-deep: #0f2a24;
  --paper: #f4f1e8;
  --paper-deep: #e9e4d8;
  --white: #fffef9;
  --sage: #dce7df;
  --sage-strong: #9bc5b6;
  --coral: #e9774d;
  --coral-dark: #c95f3a;
  --muted: #64766f;
  --line: rgba(23, 55, 47, 0.16);
  --shadow: 0 24px 70px rgba(15, 42, 36, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar,
.app-header {
  width: min(1180px, calc(100% - 48px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  letter-spacing: 0.04em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: Georgia, serif;
  font-size: 23px;
}

.brand > span:last-child {
  display: grid;
}

.brand strong {
  font-size: 14px;
  line-height: 1;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.25em;
}

.brand-light {
  color: var(--white);
}

.brand-light .brand-mark {
  background: var(--paper);
  color: var(--ink);
}

.brand-light small {
  color: #a8c1b9;
}

.button {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.button-primary {
  min-height: 52px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 12px 30px rgba(15, 42, 36, 0.16);
}

.button-primary:hover {
  background: var(--ink-deep);
}

.button-coral {
  min-height: 52px;
  background: var(--coral);
  color: #fff;
}

.button-coral:hover {
  background: var(--coral-dark);
}

.button-quiet {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.button-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.eyebrow,
.panel-kicker {
  color: #477066;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.eyebrow-light {
  color: #a9c8bd;
}

.live-dot,
.api-status i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  display: inline-block;
  border-radius: 50%;
  background: #4db18e;
  box-shadow: 0 0 0 5px rgba(77, 177, 142, 0.14);
}

.notice {
  margin: 18px 0 0;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.notice-error {
  background: #f8e4df;
  color: #8b3f2d;
}

.notice-success {
  background: #e3eee9;
  color: #346655;
}

.notice-floating {
  margin: -18px 0 20px;
  box-shadow: 0 10px 35px rgba(15, 42, 36, 0.1);
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 84% 8%, rgba(155, 197, 182, 0.42), transparent 26rem),
    linear-gradient(180deg, #f7f4ec 0%, var(--paper) 100%);
}

.api-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.auth-layout {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 82px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.72fr);
  align-items: center;
  gap: 92px;
}

.hero-copy {
  max-width: 680px;
}

.hero-copy h1 {
  margin: 24px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 5.7vw, 76px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-copy h1 em {
  color: var(--coral);
  font-weight: 400;
}

.hero-copy > p {
  max-width: 620px;
  margin: 0;
  color: #4d645d;
  font-size: 18px;
  line-height: 1.68;
}

.feature-strip {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
}

.feature-strip span {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: #4e655e;
  font-size: 11px;
  font-weight: 650;
}

.feature-strip b {
  color: var(--coral);
  font-size: 9px;
}

.auth-card {
  position: relative;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
  background: rgba(255, 254, 249, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -22px 42px auto -34px;
  z-index: -1;
  height: 170px;
  border-radius: 30px;
  background: var(--ink);
  transform: rotate(-4deg);
}

.auth-tabs {
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 999px;
  background: var(--paper);
}

.auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(15, 42, 36, 0.09);
}

.auth-form {
  padding-top: 23px;
  display: none;
  gap: 9px;
}

.auth-form.is-active {
  display: grid;
}

.auth-form h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 500;
}

.auth-form > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-form label,
.new-watch-panel label,
.field-block label {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 800;
}

.auth-form label small,
.new-watch-panel label span {
  color: var(--muted);
  font-weight: 500;
}

.auth-form input,
.new-watch-panel textarea,
.new-watch-panel input,
.field-block input,
.field-block select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: #fbfaf6;
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-form input:focus,
.new-watch-panel textarea:focus,
.new-watch-panel input:focus,
.field-block input:focus,
.field-block select:focus {
  border-color: #5e8f80;
  box-shadow: 0 0 0 4px rgba(94, 143, 128, 0.12);
}

.auth-form .button {
  width: 100%;
  margin-top: 14px;
}

.landing-footer {
  padding: 30px max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 30px;
  background: var(--ink-deep);
  color: #a9beb7;
  font-size: 11px;
}

.landing-footer span {
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.landing-footer p {
  max-width: 560px;
  margin: 0;
  text-align: right;
}

/* Dashboard */
.app-shell {
  min-height: 100vh;
  padding-bottom: 70px;
  background: linear-gradient(180deg, var(--ink) 0, var(--ink) 360px, var(--paper) 360px);
}

.app-header {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #c1d0cb;
  font-size: 12px;
}

.user-nav form {
  margin: 0;
}

.user-nav button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  cursor: pointer;
}

.user-nav a:hover,
.user-nav button:hover,
.back-link:hover {
  color: var(--white);
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-weight: 800;
}

.avatar-large {
  width: 48px;
  height: 48px;
}

.dashboard-intro {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  color: var(--white);
}

.dashboard-intro h1 {
  margin: 16px 0 7px;
  font-family: Georgia, serif;
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 400;
}

.dashboard-intro p {
  margin: 0;
  color: #b7cbc4;
  font-size: 16px;
}

.dashboard-grid {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(330px, 0.74fr) minmax(0, 1.26fr);
  align-items: start;
  gap: 24px;
}

.new-watch-panel,
.watch-list-panel,
.preview-panel,
.settings-card {
  border: 1px solid rgba(23, 55, 47, 0.09);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 16px 55px rgba(15, 42, 36, 0.08);
}

.new-watch-panel {
  padding: 30px;
}

.new-watch-panel h2,
.watch-list-panel h2,
.preview-panel h2 {
  margin: 7px 0 10px;
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 500;
}

.new-watch-panel > p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.new-watch-panel form {
  display: grid;
  gap: 10px;
}

.new-watch-panel textarea {
  min-height: 110px;
  padding: 15px;
  resize: vertical;
  line-height: 1.45;
}

.new-watch-panel form .button {
  width: 100%;
  margin-top: 12px;
}

.watch-list-panel {
  min-height: 480px;
  padding: 30px;
}

.panel-heading {
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.count-badge,
.verified-pill {
  min-height: 27px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--sage);
  color: #37695b;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.watch-list {
  display: grid;
}

.watch-row {
  padding: 20px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.watch-row:last-child {
  border-bottom: 0;
}

.watch-row-paused {
  opacity: 0.52;
}

.watch-row-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--sage);
  color: #37695b;
  font-size: 11px;
  font-weight: 900;
}

.watch-row-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.watch-row-copy strong,
.watch-row-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-row-copy strong {
  font-size: 14px;
}

.watch-row-copy span {
  color: var(--muted);
  font-size: 12px;
}

.watch-row-copy small {
  color: #789087;
  font-size: 10px;
}

.watch-row-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.watch-row-actions form {
  margin: 0;
}

.watch-row-actions a,
.watch-row-actions button {
  padding: 5px;
  border: 0;
  background: transparent;
  color: #4d7166;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.watch-row-actions .danger-link {
  color: #a95b46;
}

.empty-state {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.empty-state > span {
  margin-bottom: 12px;
  color: #6d9387;
  font-size: 42px;
}

.empty-state strong {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 18px;
}

.empty-state p {
  margin: 7px 0 0;
  font-size: 12px;
}

.last-run {
  margin-top: 18px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.last-run .live-dot {
  box-shadow: none;
}

.preview-panel {
  width: min(1180px, calc(100% - 48px));
  margin: 24px auto 0;
  padding: 30px;
}

.preview-note {
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.no-results {
  padding: 28px;
  border: 1px dashed rgba(23, 55, 47, 0.22);
  border-radius: 15px;
  background: var(--paper);
}

.no-results strong {
  font-family: Georgia, serif;
  font-size: 17px;
}

.no-results p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.decision-list {
  display: grid;
}

.decision-row {
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.decision-row:last-child {
  border-bottom: 0;
}

.decision-row div {
  display: grid;
  gap: 7px;
}

.decision-row strong {
  font-size: 14px;
  line-height: 1.45;
}

.decision-row div span {
  color: var(--muted);
  font-size: 11px;
}

.decision-row > span {
  color: var(--coral);
  font-size: 20px;
}

/* Settings */
.settings-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--ink) 0, var(--ink) 260px, var(--paper) 260px);
}

.back-link {
  color: #bed0ca;
  font-size: 12px;
}

.settings-content {
  width: min(820px, calc(100% - 48px));
  margin: 0 auto;
  padding: 62px 0 90px;
}

.settings-title {
  margin-bottom: 36px;
  color: var(--white);
}

.settings-title h1 {
  margin: 16px 0 9px;
  font-family: Georgia, serif;
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 400;
}

.settings-title p {
  margin: 0;
  color: #bad0c9;
}

.settings-card {
  padding: 34px;
}

.account-strip {
  margin: -8px -8px 28px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  border-radius: 18px;
  background: var(--paper);
}

.account-strip div {
  display: grid;
  gap: 5px;
}

.account-strip div span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.account-strip strong {
  font-size: 13px;
}

.field-block {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.field-block p {
  margin: 5px 0 13px;
  color: var(--muted);
  font-size: 12px;
}

.field-block select {
  max-width: 170px;
}

.toggle-row {
  position: relative;
  padding: 24px 62px 24px 0;
  display: block;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.toggle-row div {
  display: grid;
  gap: 5px;
}

.toggle-row strong {
  font-size: 13px;
}

.toggle-row div span {
  color: var(--muted);
  font-size: 12px;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle-ui {
  position: absolute;
  top: 25px;
  right: 0;
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: #c9d2ce;
  transition: background 160ms ease;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease;
}

.toggle-row input:checked + .toggle-ui {
  background: #4d8b77;
}

.toggle-row input:checked + .toggle-ui::after {
  transform: translateX(21px);
}

.settings-card > form > .button {
  margin-top: 2px;
}

.email-test {
  margin-top: 30px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #d5e1dc;
  border-radius: 16px;
  background: #edf4f0;
}

.email-test strong {
  font-size: 13px;
}

.email-test p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.email-test form {
  flex: 0 0 auto;
}

@media (max-width: 920px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 68px;
  }

  .auth-card {
    width: min(560px, 100%);
    margin: 0 auto;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar,
  .app-header,
  .auth-layout,
  .dashboard-intro,
  .dashboard-grid,
  .preview-panel,
  .settings-content {
    width: min(100% - 30px, 1180px);
  }

  .topbar,
  .app-header {
    min-height: 72px;
  }

  .api-status {
    font-size: 9px;
  }

  .auth-layout {
    padding: 58px 0 70px;
  }

  .hero-copy h1 {
    font-size: 46px;
  }

  .hero-copy > p {
    font-size: 16px;
  }

  .auth-card {
    padding: 20px;
  }

  .auth-card::before {
    inset: -17px 28px auto -20px;
  }

  .landing-footer {
    padding: 28px 20px;
    flex-direction: column;
  }

  .landing-footer p {
    text-align: left;
  }

  .user-nav {
    gap: 12px;
  }

  .user-nav > a {
    display: none;
  }

  .dashboard-intro {
    padding: 42px 0 36px;
    align-items: flex-start;
    flex-direction: column;
  }

  .new-watch-panel,
  .watch-list-panel,
  .preview-panel,
  .settings-card {
    padding: 22px;
    border-radius: 19px;
  }

  .watch-row {
    grid-template-columns: auto 1fr;
  }

  .watch-row-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .account-strip {
    grid-template-columns: auto 1fr;
  }

  .verified-pill {
    grid-column: 2;
    justify-self: start;
  }

  .back-link {
    font-size: 0;
  }

  .back-link::after {
    content: "← Πίσω";
    font-size: 12px;
  }

  .email-test {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.watch-builder .search-step {
  position: relative;
  padding: 10px 0 6px;
}

.watch-builder .search-step > label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.step-number {
  display: inline-grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.inline-step {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.entity-picker {
  position: relative;
}

.entity-picker > input[type="search"] {
  padding-right: 44px;
}

.picker-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: 290px;
  overflow-y: auto;
  border: 1px solid #cad8d2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(16, 55, 47, 0.18);
}

.picker-results[hidden] {
  display: none;
}

.picker-option {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid #e5ece9;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.picker-option:last-child {
  border-bottom: 0;
}

.picker-option:hover,
.picker-option:focus-visible {
  outline: 0;
  background: #edf4f0;
}

.picker-option strong {
  font-size: 13px;
  line-height: 1.35;
}

.picker-option span,
.picker-message,
.field-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.picker-message {
  display: block;
  padding: 14px 15px;
}

.field-hint {
  display: block;
  margin-top: 7px;
}
