:root {
  --ink: #16332c;
  --muted: #66736f;
  --green: #123f35;
  --green-2: #1d5b4b;
  --green-soft: #e8f0ed;
  --canvas: #f4f0e7;
  --card: #fffefb;
  --line: #deded8;
  --cream: #fbf7ee;
  --amber: #d89e35;
  --danger: #9d3d3a;
  --shadow: 0 18px 50px rgba(31, 48, 42, .075);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 4%, rgba(216, 158, 53, .12), transparent 22rem),
    radial-gradient(circle at 88% 30%, rgba(18, 63, 53, .08), transparent 28rem),
    var(--canvas);
}

button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, label[for], .file-button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, label:has(input:focus-visible) {
  outline: 3px solid rgba(29, 91, 75, .24);
  outline-offset: 2px;
}

.topbar {
  min-height: 74px;
  padding: 12px max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(22, 51, 44, .1);
  background: rgba(255, 254, 251, .76);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; font-weight: 800; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  color: white; background: var(--green); box-shadow: 0 8px 20px rgba(18, 63, 53, .18);
}
.brand-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.privacy-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.lock-dot { width: 8px; height: 8px; border-radius: 50%; background: #2f806b; box-shadow: 0 0 0 4px rgba(47, 128, 107, .12); }
.install-button { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 12px; padding: 10px 14px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 700; }
.install-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.shell { width: min(1120px, calc(100% - 40px)); margin: 46px auto 28px; }
.intro { display: grid; grid-template-columns: 1.2fr .8fr; align-items: end; gap: 60px; margin: 0 12px 34px; }
.eyebrow { margin: 0 0 8px; color: var(--green-2); font-weight: 800; font-size: .82rem; letter-spacing: .02em; }
.intro h1 { margin: 0; max-width: 700px; font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.45; letter-spacing: -.035em; }
.intro > p { margin: 0; color: var(--muted); line-height: 2; font-size: .96rem; }

.card {
  background: rgba(255, 254, 251, .96);
  border: 1px solid rgba(22, 51, 44, .1);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 20px;
}
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 24px; }
.section-heading h2 { margin: 1px 0 7px; font-size: 1.08rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.8; }
.step-number { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: .84rem; font-weight: 800; }

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 9px; color: var(--ink); font-size: .88rem; font-weight: 700; }
.field small { color: #89918e; font-weight: 400; }
.field-agenda { grid-column: 1 / -1; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 14px;
  padding: 14px 16px; min-height: 50px; font-size: 1rem; transition: border-color .18s, box-shadow .18s;
}
.field textarea { resize: vertical; min-height: 76px; line-height: 1.8; }
.field input:hover, .field textarea:hover { border-color: #b7c0bc; }
.field input:focus, .field textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(29,91,75,.09); outline: none; }

.recorder-card { padding-bottom: 26px; }
.recorder-heading { align-items: center; }
.status-pill { margin-right: auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .8rem; }
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: #34866f; }
.status-pill.recording { color: #8b312f; background: #f9e9e8; }
.status-pill.recording span { background: #bc4945; animation: pulse 1.3s infinite; }
.status-pill.ready { color: #5d481e; background: #f9f0db; }
.status-pill.ready span { background: var(--amber); }

.recording-stage { padding: 14px 0 0; text-align: center; }
.timer { direction: ltr; font: 800 clamp(2.7rem, 7vw, 4.6rem)/1 "Segoe UI", Arial, sans-serif; letter-spacing: .035em; color: var(--green); font-variant-numeric: tabular-nums; }
.visualizer { height: 54px; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 7px auto 4px; opacity: .34; }
.visualizer i { display: block; width: 4px; height: 5px; min-height: 4px; max-height: 42px; border-radius: 999px; background: var(--green-2); transition: height 80ms linear; }
.visualizer.active { opacity: .95; }
.stage-message { margin: 6px 0 22px; min-height: 26px; color: var(--muted); font-size: .93rem; }
.primary-actions, .delivery-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.button {
  min-height: 48px; border-radius: 14px; padding: 12px 18px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; font-weight: 800;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s, opacity .15s;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button[aria-disabled="true"] { opacity: .42; pointer-events: none; }
.button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 9px 24px rgba(18, 63, 53, .18); }
.button-primary:hover:not(:disabled), .button-share:hover:not(:disabled) { background: #0d352d; box-shadow: 0 12px 28px rgba(18, 63, 53, .24); }
.button-secondary { border-color: #cfd4d1; background: #fff; color: var(--ink); }
.button-secondary:hover:not(:disabled), .button-ghost:hover:not(:disabled) { border-color: #9eaaa5; background: #fdfdfb; }
.button-ghost { border-color: transparent; background: #f0f1ed; color: var(--ink); }
.chat-link { font-size: .86rem; }
.button-danger { display: none; background: #993f3b; color: white; box-shadow: 0 9px 24px rgba(153, 63, 59, .16); }
.button-danger.visible { display: inline-flex; }
.stop-square { width: 11px; height: 11px; background: currentColor; border-radius: 2px; }
.file-button { user-select: none; }

.capture-tip { width: min(690px, 100%); margin: 24px auto 0; padding: 13px 16px; border-radius: 14px; background: var(--cream); border: 1px solid #e8deca; text-align: right; display: flex; align-items: flex-start; gap: 10px; color: #685b40; }
.capture-tip svg { flex: 0 0 auto; width: 20px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.capture-tip p { margin: 0; font-size: .84rem; line-height: 1.85; }

.file-ready { width: min(760px, 100%); margin: 27px auto 0; padding-top: 20px; border-top: 1px solid var(--line); text-align: right; }
.file-meta { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.file-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.file-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.file-meta > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.file-meta small { color: var(--muted); }
audio { width: 100%; height: 48px; direction: ltr; }

.output-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.output-options label { min-height: 82px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; display: flex; align-items: flex-start; gap: 10px; background: #fff; cursor: pointer; transition: border .15s, background .15s; }
.output-options label:has(input:checked) { border-color: #8bb1a6; background: #f3f8f6; }
.output-options input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green-2); }
.output-options span { display: flex; flex-direction: column; gap: 6px; }
.output-options b { font-size: .86rem; }
.output-options small { color: var(--muted); line-height: 1.6; font-size: .76rem; }
.delivery-actions { margin-top: 22px; justify-content: flex-start; }
.button-share { min-width: 230px; background: var(--green); color: #fff; box-shadow: 0 9px 24px rgba(18, 63, 53, .18); }
.delivery-note { margin: 13px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.8; }

.mobile-warning { margin: 22px 0; border: 1px solid #e4c985; background: #fff8e6; border-radius: 18px; padding: 17px 18px; display: flex; align-items: flex-start; gap: 13px; color: #67501d; }
.mobile-warning > div { width: 36px; height: 36px; border-radius: 11px; background: #f9e7b7; display: grid; place-items: center; flex: 0 0 auto; }
.mobile-warning svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mobile-warning p { display: flex; flex-direction: column; gap: 6px; margin: 0; line-height: 1.8; }
.mobile-warning span { font-size: .86rem; }

footer { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 15px 0 34px; color: #7a8581; text-align: center; font-size: .78rem; }

.capture-dialog { width: min(500px, calc(100% - 30px)); padding: 0; color: var(--ink); background: var(--card); border: 0; border-radius: 24px; box-shadow: 0 30px 90px rgba(10, 30, 24, .24); }
.capture-dialog::backdrop { background: rgba(14, 28, 24, .56); backdrop-filter: blur(4px); }
.capture-dialog form { padding: 32px; position: relative; }
.dialog-close { position: absolute; left: 18px; top: 15px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #eef0ec; color: #59645f; font-size: 1.45rem; cursor: pointer; }
.dialog-icon { width: 50px; height: 50px; margin-bottom: 16px; border-radius: 15px; display: grid; place-items: center; color: white; background: var(--green); }
.dialog-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.capture-dialog h2 { margin: 0 0 17px; font-size: 1.22rem; }
.capture-dialog ol { margin: 0; padding: 0 22px 0 0; line-height: 2.1; font-size: .9rem; }
.capture-dialog p { color: var(--muted); font-size: .82rem; line-height: 1.8; }
.dialog-confirm { width: 100%; margin-top: 8px; }

.toast { position: fixed; z-index: 30; inset: auto 50% 24px auto; transform: translateX(50%); max-width: min(430px, calc(100% - 32px)); padding: 13px 18px; border-radius: 13px; background: #1c302a; color: white; box-shadow: 0 14px 34px rgba(12, 35, 28, .26); font-size: .88rem; text-align: center; animation: toastIn .22s ease-out; }

@keyframes pulse { 50% { opacity: .35; transform: scale(.82); } }
@keyframes toastIn { from { opacity: 0; transform: translate(50%, 8px); } }

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 680px); margin-top: 28px; }
  .intro { grid-template-columns: 1fr; gap: 12px; margin: 0 4px 24px; }
  .intro > p { font-size: .88rem; }
  .form-grid { grid-template-columns: 1fr; }
  .field-agenda { grid-column: auto; }
  .output-options { grid-template-columns: repeat(2, 1fr); }
  .privacy-badge { display: none; }
}

@media (max-width: 520px) {
  .topbar { min-height: 64px; padding: 10px 14px; }
  .brand-mark { width: 36px; height: 36px; }
  .shell { width: calc(100% - 20px); margin-top: 22px; }
  .intro h1 { font-size: 1.58rem; line-height: 1.55; }
  .card { padding: 20px 16px; border-radius: 20px; }
  .section-heading { margin-bottom: 20px; }
  .recorder-heading { align-items: flex-start; flex-wrap: wrap; }
  .status-pill { margin-right: 45px; margin-top: -12px; }
  .recording-stage { padding-top: 7px; }
  .timer { font-size: 2.65rem; }
  .visualizer { gap: 3px; height: 46px; }
  .visualizer i { width: 3px; }
  .primary-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .primary-actions .button { padding: 11px 9px; font-size: .82rem; }
  .button-danger, .button-danger.visible { grid-column: 1 / -1; }
  .capture-tip { padding: 12px; }
  .output-options { grid-template-columns: 1fr; }
  .output-options label { min-height: 70px; }
  .delivery-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .delivery-actions .button-share { grid-column: 1 / -1; width: 100%; }
  .delivery-actions .button { min-width: 0; padding-inline: 10px; }
  .capture-dialog form { padding: 28px 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
