details.dev-collapse,
details.dev-raw {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafcfb;
  padding: 0.6rem 0.75rem;
}

details.dev-collapse summary,
details.dev-raw summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  user-select: none;
}

details.dev-collapse[open] summary,
details.dev-raw[open] summary {
  color: var(--accent);
  margin-bottom: 0.6rem;
}

:root {
  --ink: #14201b;
  --muted: #5a6a62;
  --line: #d5ddd8;
  --panel: #fff;
  --bg: #eef2ef;
  --accent: #0b6e56;
  --accent-soft: #e6f4ef;
  --warn: #9a4d12;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #e7eee9, var(--bg));
  overflow-x: hidden;
}

.app {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  overflow-x: clip;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0.2rem 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 36rem;
}

.badge {
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.badge.warn {
  background: #f8ebe0;
  color: var(--warn);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 10px 28px rgba(20, 32, 27, 0.05);
  overflow-x: clip;
  max-width: 100%;
}

.panel h2 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: 1.05rem;
}

.row,
.search-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

input[type="url"],
input[type="search"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
}

.plan-form {
  flex-direction: column;
  align-items: stretch;
}

.plan-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  resize: vertical;
  min-height: 6rem;
}

.plan-form .btn {
  align-self: flex-start;
}

.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.plan-table th,
.plan-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.plan-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.plan-table tfoot td {
  border-bottom: none;
  padding-top: 0.85rem;
}

.budget-warning {
  background: #fff7e6;
  border: 1px solid #e6a700;
  border-left: 4px solid #e6a700;
  color: var(--warn);
  padding: 1rem 1.15rem;
  border-radius: 10px;
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
  line-height: 1.45;
}

.day-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin: 0.85rem 0;
}

.stay-card {
  background: var(--accent-soft);
}

.schedule-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.schedule-item {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.schedule-time {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.schedule-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.schedule-body p {
  margin: 0.35rem 0 0;
  color: var(--ink);
}

.btn {
  border: 1px solid var(--line);
  background: #f5f8f6;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #f7fffb;
}

.btn.ghost {
  background: transparent;
}

.hint,
.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.hint {
  margin: 0.55rem 0 0;
}

.presets,
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.chip {
  border: 1px solid var(--line);
  background: #f5f8f6;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.65rem 0;
}

.results,
.data-grid {
  display: grid;
  gap: 0.75rem;
  max-width: 100%;
}

.card {
  display: grid;
  grid-template-columns: minmax(0, 96px) minmax(0, 1fr);
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fafcfb;
  overflow: hidden;
  max-width: 100%;
}

.card:not(:has(.thumb-link)):not(:has(.thumb-placeholder)) {
  grid-template-columns: 1fr;
}

.thumb-link,
.data-thumb-link {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  align-self: start;
}

.thumb {
  display: block;
  width: 96px;
  max-width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #dfe8e3;
}

.thumb-placeholder {
  width: 96px;
  max-width: 100%;
  height: 72px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    -45deg,
    #e4ebe7,
    #e4ebe7 6px,
    #d5ddd8 6px,
    #d5ddd8 12px
  );
}

.card-body,
.data-body {
  min-width: 0;
  overflow-wrap: anywhere;
}

.card h3,
.data-body h3 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.data-body h3 {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  background: #fff;
}

.pill.cat {
  background: var(--accent-soft);
  border-color: #c6e2d7;
  color: var(--accent);
}

.card p {
  margin: 0.2rem 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.card a,
.data-fields a {
  color: var(--accent);
  word-break: break-all;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.code {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  background: #13201a;
  color: #d7ebe2;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  word-break: break-all;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 720px) {
  .stat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.stat {
  background: #f5f8f6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.45rem;
  text-align: center;
  min-width: 0;
}

.stat-n {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--accent);
  line-height: 1.1;
}

.stat-l {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bars {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.loop-badge {
  display: inline-block;
  margin: 0.35rem 0 0.55rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eceff1;
  color: var(--muted);
}

.loop-badge.on {
  background: #e6f4ef;
  color: var(--accent);
}

.loop-badge.off {
  background: #f8ebe0;
  color: var(--warn);
}

.bar-row {
  min-width: 0;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.3rem;
  font-size: 0.88rem;
}

.bar-nums {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e4ebe7;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b6e56, #1f9a74);
  transition: width 0.4s ease;
}

.bar-sub {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.nav-links .chip.active,
.filter-chip.active {
  background: var(--accent-soft);
  border-color: #c6e2d7;
  color: var(--accent);
  font-weight: 700;
}

.row-tight {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.data-card {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  background: #fafcfb;
  overflow: hidden;
  max-width: 100%;
}

@media (max-width: 640px) {
  .data-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .data-thumb {
    height: 160px;
    max-height: 180px;
  }
}

.data-thumb {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 110px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  background: #dfe8e3;
}

.data-thumb.placeholder {
  width: 100%;
  height: 110px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    -45deg,
    #e4ebe7,
    #e4ebe7 6px,
    #d5ddd8 6px,
    #d5ddd8 12px
  );
}

.data-fields {
  display: grid;
  gap: 0.25rem;
  font-size: 0.84rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.data-fields .k {
  display: inline-block;
  min-width: 4.5rem;
  color: var(--ink);
  font-weight: 600;
  margin-right: 0.35rem;
}

.agent-workbench {
  position: relative;
  overflow: hidden;
  border: 1px solid #c6e2d7;
  border-radius: 18px;
  padding: 1.15rem 1.15rem 1.2rem;
  background:
    radial-gradient(90% 70% at 8% 0%, rgba(47, 168, 122, 0.18), transparent 50%),
    radial-gradient(70% 60% at 100% 10%, rgba(11, 110, 86, 0.1), transparent 45%),
    linear-gradient(165deg, #f7fbf9 0%, #eef6f2 55%, #e8f2ed 100%);
  box-shadow: 0 18px 40px rgba(20, 32, 27, 0.07);
  animation: agent-in 0.4s ease-out;
}

.agent-workbench::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0b6e56, #3dcf8e, transparent);
  opacity: 0.7;
}

@keyframes agent-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.agent-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.agent-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}

.agent-orb {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, #9aefc8, #1f9a74 42%, #0b6e56 78%);
  box-shadow:
    0 0 0 4px rgba(11, 110, 86, 0.1),
    0 8px 18px rgba(11, 110, 86, 0.22);
  animation: agent-orb 2.8s ease-in-out infinite;
}

@keyframes agent-orb {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 4px rgba(11, 110, 86, 0.1),
      0 8px 18px rgba(11, 110, 86, 0.22);
  }
  50% {
    transform: scale(1.05);
    box-shadow:
      0 0 0 7px rgba(11, 110, 86, 0.08),
      0 10px 22px rgba(11, 110, 86, 0.28);
  }
}

.agent-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--accent);
}

.agent-title {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.6vw, 1.28rem);
  font-weight: 650;
  line-height: 1.2;
}

.agent-timer {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #c6e2d7;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.agent-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(20, 32, 27, 0.08);
  overflow: hidden;
  margin-bottom: 1rem;
}

.agent-bar-fill {
  height: 100%;
  width: 6%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b6e56, #2aa67a, #7bc9a8);
  transition: width 0.7s ease;
}

.agent-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}

.agent-step {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.42rem 0.55rem;
  border-radius: 10px;
  color: var(--muted);
  transition: background 0.35s ease, color 0.35s ease;
}

.agent-step.done {
  color: var(--ink);
}

.agent-step.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(11, 110, 86, 0.14);
  font-weight: 600;
}

.agent-mark {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.agent-step.done .agent-mark {
  color: var(--accent);
}

.agent-step.active .agent-mark {
  color: var(--accent);
}

.agent-step-title {
  font-size: 0.9rem;
  line-height: 1.35;
}

.agent-live {
  display: grid;
  grid-template-columns: 0.7rem 1fr;
  gap: 0.65rem;
  align-items: start;
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(61, 207, 142, 0.18), transparent 50%),
    linear-gradient(145deg, #102019, #163126);
  color: #d7ebe2;
  min-height: 3.4rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.agent-pulse {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.55rem;
  border-radius: 50%;
  background: #3dcf8e;
  box-shadow: 0 0 0 0 rgba(61, 207, 142, 0.45);
  animation: agent-soft-ping 2.4s ease-out infinite;
}

@keyframes agent-soft-ping {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 207, 142, 0.4);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(61, 207, 142, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 207, 142, 0);
  }
}

.agent-live-label {
  margin: 0 0 0.15rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7bc9a8;
}

.agent-detail {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
  color: #e7f6ef;
}
