/* Agent Walkthrough. Palette and contrast ratios: docs/agentwalkthrough/design.md */
:root {
  --bg: #F6F4EE;
  --surface: #FFFFFF;
  --sage: #A8BFA3;          /* decoration only: never text */
  --sage-tint: #E4ECDF;
  --primary: #4E6B52;
  --primary-hover: #3F5843;
  --text: #27332A;
  --muted: #5E6B60;
  --clay: #9C5B3C;          /* considerations, "professional" */
  --wheat: #7A6433;         /* features */
  --line: #DCE3D6;
  --danger: #9C3C3C;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(39, 51, 42, 0.06), 0 4px 16px rgba(39, 51, 42, 0.05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Layout */
.aw-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.aw-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.aw-brand-mark {
  width: 28px; height: 28px; border-radius: 6px; background: var(--primary);
  display: grid; place-items: center; color: #fff; font-size: 0.85rem;
}
.aw-main { width: min(860px, 100%); margin: 0 auto; padding: 20px 16px 40px; flex: 1; }
.aw-narrow { width: min(460px, 100%); }
.aw-footer {
  padding: 16px; border-top: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 0.8rem; text-align: center;
}

/* Cards and panels */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.banner {
  border-radius: var(--radius); padding: 10px 14px; font-size: 0.9rem;
  background: var(--sage-tint); color: var(--text); border: 1px solid var(--line);
}
.banner.warn { background: #F5EADF; border-color: #E6D2BF; }
.banner.error { background: #F6E3E3; border-color: #E8C8C8; color: var(--danger); }

.disclaimer {
  font-size: 0.85rem; color: var(--muted); background: var(--sage-tint);
  border-left: 3px solid var(--sage); border-radius: 4px; padding: 10px 12px;
}

/* Forms */
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid #C9D3C4; border-radius: 6px; padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.field-hint { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; border-radius: 6px; padding: 10px 16px; cursor: pointer;
  border: 1px solid transparent; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn-quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
.link-button { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* Property list */
.property-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.property-card { display: block; text-decoration: none; color: var(--text); }
.property-card:hover { border-color: var(--sage); }
.chip {
  display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--sage-tint); color: var(--primary);
}
.chip.clay { background: #F3E6DE; color: var(--clay); }
.chip.wheat { background: #F1EBDB; color: var(--wheat); }

/* Rooms, notes, photos */
.room { border-top: 1px solid var(--line); padding-top: 12px; }
.room:first-child { border-top: 0; padding-top: 0; }
.note { background: var(--bg); border-radius: 6px; padding: 10px 12px; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 6px; }
.note-meta { font-size: 0.78rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo {
  position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
  background: var(--sage-tint); display: grid; place-items: center; font-size: 0.7rem; color: var(--muted); text-align: center; padding: 4px;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .remove {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(39, 51, 42, 0.7); color: #fff; cursor: pointer; font-size: 0.9rem;
}

dialog {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(460px, calc(100% - 32px));
  color: var(--text); background: var(--surface);
}
dialog::backdrop { background: rgba(39, 51, 42, 0.35); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 640px) {
  h1 { font-size: 1.9rem; }
  .aw-main { padding-top: 28px; }
}

/* Room-first capture: where the agent is standing right now. */
.current-room {
  margin: 0; padding: 10px 12px; border-radius: 6px;
  background: var(--sage-tint); border-left: 3px solid var(--primary); font-size: 1.05rem;
}
optgroup { font-weight: 700; }

/* What the AI sorted from a note. */
.ai-items ul { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 6px; }
.ai-items li { display: grid; grid-template-columns: 8.2em 1fr; column-gap: 8px; row-gap: 2px; align-items: baseline; font-size: 0.92rem; }
.kind { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.kind-highlight { color: var(--primary); }
.kind-consideration { color: var(--clay); }
.kind-feature { color: var(--wheat); }
.ai-action { grid-column: 2; color: var(--muted); font-size: 0.85rem; }

/* Review screen (phase 4). */
.review-columns { display: grid; gap: 16px; }
@media (min-width: 760px) { .review-columns { grid-template-columns: repeat(3, 1fr); } }
.review-column h3 { margin-bottom: 6px; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.review-item { background: var(--bg); border-radius: 6px; padding: 8px 10px; display: grid; gap: 4px; }
.review-item.is-hidden { opacity: 0.6; }
.review-item.is-hidden .review-text { text-decoration: line-through; }
.review-text { overflow-wrap: anywhere; }
.review-tags { gap: 6px 10px; font-size: 0.85rem; }
.review-fixes { border-top: 1px solid var(--line); padding-top: 12px; }
.chip-button { border: 0; cursor: pointer; font: inherit; font-size: 0.75rem; font-weight: 600; min-height: 28px; }
.danger-link { color: var(--danger); }
.signed-off { border-left: 4px solid var(--primary); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--sage-tint); padding: 1px 4px; border-radius: 4px; }

/* Branding (phase 5). */
.logo-preview { min-height: 64px; display: flex; align-items: center; padding: 8px; border: 1px dashed var(--line); border-radius: 6px; background: var(--surface); }
.logo-preview img { max-width: 240px; max-height: 80px; display: block; }
input[type="color"] { width: 64px; height: 40px; padding: 2px; border: 1px solid #C9D3C4; border-radius: 6px; background: var(--surface); }

/* Plan and billing (phase 6). */
.plan-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; justify-items: start; background: var(--surface); }
.plan-card h3 { margin: 0; }
.plan-price { margin: 0; font-size: 1.05rem; }
.plan-price strong { font-size: 1.5rem; }

/* Terms and privacy (phase 7). */
.legal h2 { margin-top: 28px; }
.legal li { margin-bottom: 6px; }
.aw-footer a { color: var(--muted); }
