/* Version: 0.6.15 (2026-05-12) */
/* Major changes: */
/* - 0.6.15: Added compact datetime/layout wrapping support to prevent overlap in dense dashboard fields. */
/* - 0.6.14: Updated compact watchlist add-form layout to description-first with dedicated second-line URL input. */
/* - 0.6.13: Added compact watchlist inline-add and high-density accordion styling. */
/* - 0.3: Added styling for latest-check table cells and Run Check action controls. */
/* - 0.2: Added watchlist table and action styling for CRUD UI. */
/* - 0.1: Added responsive visual style for dashboard and settings UI. */

:root {
  --bg: #f5f2eb;
  --ink: #1f2a33;
  --card: rgba(255, 255, 255, 0.78);
  --accent: #d45b35;
  --accent-dark: #8b3118;
  --support: #0f6b5c;
  --warning: #8b1f27;
  --line: rgba(31, 42, 51, 0.18);
  --shadow: 0 18px 48px rgba(31, 42, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Sora", sans-serif;
  background: radial-gradient(circle at 12% 14%, #fbd6b5 0%, transparent 36%),
    radial-gradient(circle at 88% 20%, #c5ebdb 0%, transparent 38%),
    linear-gradient(180deg, #f7f3ec 0%, #eee7dd 100%);
  position: relative;
}

.atmosphere {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(56px);
  opacity: 0.35;
  pointer-events: none;
}

.atmosphere-one {
  width: 260px;
  height: 260px;
  top: 54px;
  right: 40px;
  background: #f08d52;
  animation: driftOne 11s ease-in-out infinite;
}

.atmosphere-two {
  width: 320px;
  height: 320px;
  bottom: 24px;
  left: 20px;
  background: #31a090;
  animation: driftTwo 12s ease-in-out infinite;
}

.topbar,
.page-shell,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 26px 28px 12px;
}

.brand-wrap h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: 0.02em;
}

.brand-wrap p {
  margin: 8px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  opacity: 0.84;
}

.main-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.54);
  transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  transform: translateY(-1px);
  border-color: rgba(212, 91, 53, 0.65);
  background: rgba(212, 91, 53, 0.1);
}

.page-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 12px auto 28px;
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two-up {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  animation: riseIn 0.45s ease;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 1.06rem;
}

.card dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.card dl div {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) 1.3fr;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(31, 42, 51, 0.1);
}

.card dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  opacity: 0.75;
}

.card dd {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 600;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: grid;
  gap: 6px;
}

label span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  opacity: 0.8;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(31, 42, 51, 0.26);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.82);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 107, 92, 0.24);
  border-color: var(--support);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
}

.full-width {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-actions form {
  margin: 0;
}

.link-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

button.ghost-danger {
  background: rgba(139, 31, 39, 0.12);
  color: var(--warning);
  border: 1px solid rgba(139, 31, 39, 0.35);
  padding: 6px 10px;
}

button.soft-action {
  background: rgba(15, 107, 92, 0.14);
  color: #0f6b5c;
  border: 1px solid rgba(15, 107, 92, 0.36);
  padding: 6px 10px;
}

.table-wrap {
  overflow-x: auto;
}

.watchlist-inline-add {
  padding: 12px;
}

.watchlist-inline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.watchlist-inline-head h2 {
  margin: 0;
}

.watchlist-inline-head p {
  margin: 0;
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
  opacity: 0.7;
}

.inline-add-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.9fr) minmax(110px, 0.8fr) minmax(180px, 1.1fr) auto;
  gap: 8px;
  align-items: end;
}

.inline-url-row {
  grid-column: 1 / -1;
}

.inline-add-form .inline-field {
  gap: 4px;
}

.inline-add-form .inline-field span {
  font-size: 0.72rem;
}

.inline-add-form input {
  padding: 8px 9px;
  border-radius: 9px;
}

.inline-submit {
  white-space: nowrap;
  padding: 9px 14px;
}

.watchlist-edit-panel {
  padding-top: 12px;
}

.watchlist-density {
  padding: 12px;
}

.watchlist-density h2 {
  margin-bottom: 10px;
}

.watchlist-header-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.1fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) minmax(90px, 0.8fr);
  gap: 8px;
  padding: 0 8px 6px;
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.watchlist-accordion {
  display: grid;
  gap: 6px;
}

.watch-row {
  border: 1px solid rgba(31, 42, 51, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.watch-row summary {
  list-style: none;
  cursor: pointer;
}

.watch-row summary::-webkit-details-marker {
  display: none;
}

.watch-summary-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.1fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) minmax(90px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  font-size: 0.86rem;
}

.watch-row[open] .watch-summary-row {
  background: rgba(31, 42, 51, 0.05);
}

.summary-cell {
  min-width: 0;
}

.summary-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  border: 1px solid transparent;
}

.status-active {
  background: rgba(15, 107, 92, 0.14);
  border-color: rgba(15, 107, 92, 0.34);
  color: #0f6b5c;
}

.status-alerted {
  background: rgba(212, 91, 53, 0.15);
  border-color: rgba(212, 91, 53, 0.36);
  color: #8b3118;
}

.status-error {
  background: rgba(139, 31, 39, 0.12);
  border-color: rgba(139, 31, 39, 0.35);
  color: var(--warning);
}

.status-paused {
  background: rgba(31, 42, 51, 0.1);
  border-color: rgba(31, 42, 51, 0.24);
  color: #1f2a33;
}

.watch-row-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid rgba(31, 42, 51, 0.1);
}

.watch-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 12px;
  font-size: 0.84rem;
}

.watch-meta-grid strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  opacity: 0.82;
}

.dense-actions {
  gap: 6px;
  flex-wrap: wrap;
}

.dense-actions .link-button,
.dense-actions button {
  font-size: 0.78rem;
  padding: 6px 9px;
}

.mini-history {
  border-top: 1px dashed rgba(31, 42, 51, 0.2);
  padding-top: 8px;
}

.mini-history h3 {
  margin: 0 0 6px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: "IBM Plex Mono", monospace;
  opacity: 0.78;
}

.mini-table {
  font-size: 0.8rem;
}

.mini-table th,
.mini-table td {
  padding: 6px 4px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.kpi-card {
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: "IBM Plex Mono", monospace;
  opacity: 0.78;
}

.kpi-value {
  font-size: 1.18rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.kpi-small {
  font-size: 0.88rem;
}

.kpi-subtle {
  font-size: 0.72rem;
  opacity: 0.72;
  font-family: "IBM Plex Mono", monospace;
}

.dashboard-dense-panels {
  padding: 12px;
}

.dashboard-dense-panels h2 {
  margin-bottom: 8px;
}

.dash-panel {
  border: 1px solid rgba(31, 42, 51, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  margin-bottom: 8px;
  overflow: hidden;
}

.dash-panel:last-child {
  margin-bottom: 0;
}

.dash-panel summary {
  cursor: pointer;
  padding: 8px 10px;
  font-size: 0.86rem;
  font-weight: 700;
  list-style: none;
}

.dash-panel summary::-webkit-details-marker {
  display: none;
}

.dash-panel[open] summary {
  border-bottom: 1px solid rgba(31, 42, 51, 0.1);
  background: rgba(31, 42, 51, 0.05);
}

.dash-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px 10px;
  padding: 8px 10px 10px;
}

.dash-kv-grid div {
  display: grid;
  gap: 2px;
  font-size: 0.82rem;
  min-width: 0;
}

.dash-kv-grid strong {
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  opacity: 0.78;
}

.dash-kv-grid span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dash-kv-full {
  grid-column: 1 / -1;
}

.dense-table {
  font-size: 0.82rem;
}

.dense-table th,
.dense-table td {
  padding: 7px 5px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid rgba(31, 42, 51, 0.12);
  padding: 9px 6px;
  vertical-align: top;
}

th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  opacity: 0.85;
}

.subtle {
  margin-top: 4px;
  font-size: 0.78rem;
  opacity: 0.76;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

button.ghost-danger:hover {
  filter: none;
  background: rgba(139, 31, 39, 0.2);
}

button.soft-action:hover {
  filter: none;
  background: rgba(15, 107, 92, 0.22);
}

.flash {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid;
  font-size: 0.9rem;
  font-family: "IBM Plex Mono", monospace;
}

.flash-success {
  color: #0f6b5c;
  border-color: rgba(15, 107, 92, 0.4);
  background: rgba(15, 107, 92, 0.1);
}

.flash-error {
  color: var(--warning);
  border-color: rgba(139, 31, 39, 0.4);
  background: rgba(139, 31, 39, 0.1);
}

.footer {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  opacity: 0.72;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes driftOne {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-12px, 10px);
  }
}

@keyframes driftTwo {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(14px, -12px);
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 20px 16px 8px;
  }

  .page-shell,
  .footer {
    width: calc(100% - 20px);
  }

  .card dl div {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    gap: 4px;
  }

  .inline-add-form {
    grid-template-columns: 1fr;
  }

  .watchlist-inline-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .watchlist-header-row {
    display: none;
  }

  .watch-summary-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .watch-summary-row .summary-cell:last-child {
    justify-self: end;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-kv-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    font-size: 0.82rem;
  }
}
