:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1d302b;
  background: #f5f7f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #1d302b;
  --muted: #60716b;
  --line: #dce5df;
  --accent: #176b50;
  --accent-dark: #10543e;
  --accent-soft: #e9f4ee;
  --surface: #fff;
  --danger: #a63e32;
  --shadow: 0 16px 48px rgb(32 58 47 / 7%);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  padding: 44px 20px 56px;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(100%, 850px);
  margin: 0 auto;
}

.page-header {
  margin: 0 0 28px;
}

.eyebrow,
.step-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.intro {
  max-width: 630px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.panel {
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.results-panel {
  margin-top: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.privacy-label,
.count-label {
  flex: none;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 650;
}

.privacy-label span {
  padding-right: 5px;
  color: #46a277;
  font-size: 0.65rem;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

textarea,
.template-control input {
  width: 100%;
  border: 1px solid #cbd8d0;
  border-radius: 11px;
  background: #fcfdfc;
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 220px;
  padding: 14px 15px;
  resize: vertical;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.55;
}

.template-control input {
  padding: 12px 13px;
}

textarea:focus,
.template-control input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(23 107 80 / 12%);
}

.form-footer,
.export-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.help-text,
.page-footer {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.form-footer .help-text,
.export-footer .message {
  margin: 0;
}

.button {
  min-height: 44px;
  padding: 11px 17px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: background 140ms ease, transform 140ms ease, opacity 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(23 107 80 / 25%);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary {
  flex: none;
  background: var(--accent);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.message {
  min-height: 1.25em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--accent-dark);
}

.results-heading {
  margin-bottom: 12px;
}

.template-control {
  margin: 24px 0 22px;
}

.reminder-control {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.reminder-control legend {
  padding: 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.reminder-control .help-text {
  margin: -5px 0 0;
}

.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.reminder-option {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.reminder-time {
  min-width: 125px;
  padding: 7px 9px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #fcfdfc;
  color: var(--ink);
  font: inherit;
}

.template-control .help-text {
  margin: 8px 0 0;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f0f4f1;
  color: #305248;
  font-size: 0.8rem;
}

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  cursor: pointer;
}

.selection-count {
  color: var(--muted);
  font-size: 0.84rem;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.groups-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.group-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.group-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.group-select {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  cursor: pointer;
}

.group-select input {
  margin-top: 3px;
}

.group-date {
  margin: 0 0 4px;
  font-weight: 750;
}

.group-location {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.group-total {
  flex: none;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.group-title-preview {
  margin: 14px 0 8px 28px;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.media-list {
  display: grid;
  gap: 5px;
  margin: 0 0 0 28px;
  padding-left: 17px;
  color: #43564f;
  font-size: 0.85rem;
  line-height: 1.45;
}

.group-download {
  margin: 14px 0 0 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.export-footer {
  align-items: flex-end;
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.export-footer .message {
  max-width: 390px;
}

.page-footer {
  padding: 20px 8px 0;
  text-align: center;
}

.page-footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 620px) {
  body {
    padding: 28px 14px 40px;
  }

  .section-heading,
  .form-footer,
  .export-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .privacy-label,
  .count-label {
    align-self: flex-start;
  }

  .button-primary {
    width: 100%;
  }

  .group-topline {
    gap: 10px;
  }

  .group-total {
    font-size: 0.74rem;
  }
}
