:root {
  color-scheme: light;
  --ink: #181a17;
  --muted: #666b60;
  --line: #d9d8cf;
  --field: #ffffff;
  --surface: #fffdf7;
  --page: #f7f5ee;
  --accent: #ffcf4a;
  --accent-ink: #181a17;
  --success: #147a58;
  --success-ink: #ffffff;
  --warn: #8a4d00;
  --warn-bg: #fff0b8;
  --info: #245f93;
  --info-bg: #dff0ff;
  --rose: #f06d5c;
  --shadow: rgba(24, 26, 23, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.app-shell {
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-size: 1.1rem;
  font-weight: 900;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.pixel-calendar {
  width: 44px;
  height: 44px;
  position: relative;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background:
    linear-gradient(135deg, transparent 0 82%, #ea4335 82% 100%),
    linear-gradient(90deg, transparent 0 68%, #fbbc04 68% 100%),
    linear-gradient(180deg, #4285f4 0 34%, transparent 34% 68%, #34a853 68% 100%),
    #4285f4;
  box-shadow: 0 10px 24px var(--shadow);
}

.pixel-calendar::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 22px;
  height: 20px;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: inset 0 4px 0 #e8f0fe;
}

.pixel-calendar::after {
  content: "CL";
  position: absolute;
  left: 14px;
  top: 18px;
  width: 22px;
  color: #1a73e8;
  font-size: 11px;
  line-height: 16px;
  font-weight: 950;
  text-align: center;
  letter-spacing: 0;
}

.pixel-calendar span {
  display: none;
}

.pixel-calendar {
  border-radius: 16px;
  background: url("/icons/icon96.png") center / cover no-repeat;
}

.pixel-calendar::before,
.pixel-calendar::after {
  content: none;
  display: none;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.topnav a,
.topnav button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 850;
  box-shadow: none;
}

.topnav a:hover,
.topnav button:hover,
.topnav a:focus-visible,
.topnav button:focus-visible,
.brand:focus-visible,
.text-link:focus-visible,
footer a:focus-visible {
  outline: 3px solid rgba(22, 23, 18, 0.24);
  outline-offset: 3px;
}

.intro {
  display: grid;
  gap: 10px;
  padding: 14px 0 0;
}

.headline {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.mark {
  width: fit-content;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 7px 10px;
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: 3.25rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.subtitle {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.45;
  font-weight: 680;
}

.promise-stack {
  display: grid;
  gap: 10px;
  align-content: end;
  margin: 0;
}

.promise,
.promise-stack span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  box-shadow: 0 10px 24px var(--shadow);
  font-weight: 800;
  line-height: 1.3;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.composer,
.result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 34px var(--shadow);
}

.composer {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.form-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}

#meeting-hint {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

textarea {
  width: 100%;
  min-height: 260px;
  flex: 1;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--field);
  color: var(--ink);
  line-height: 1.45;
  box-shadow: inset 0 1px 2px rgba(24, 26, 23, 0.06);
}

textarea:focus {
  border-color: #fbbc04;
  outline: 3px solid rgba(251, 188, 4, 0.22);
  outline-offset: 0;
}

.sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

button,
.link-button {
  min-height: 44px;
  border: 1px solid rgba(24, 26, 23, 0.18);
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(24, 26, 23, 0.12);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
}

.compact {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.92rem;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

button:active,
.link-button:active,
.topnav a:active,
.topnav button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(24, 26, 23, 0.12);
}

button:focus-visible,
.link-button:focus-visible {
  outline: 3px solid rgba(22, 23, 18, 0.24);
  outline-offset: 3px;
}

.secondary {
  background: #ffffff;
  color: var(--ink);
}

.sample-chip {
  min-height: 34px;
  padding: 0 10px;
  background: #ffffff;
  box-shadow: none;
  font-size: 0.86rem;
}

.result-actions .link-button:first-child {
  background: var(--success);
  color: var(--success-ink);
}

.text-link,
footer a {
  color: var(--ink);
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.result {
  padding: 16px;
  overflow-wrap: anywhere;
  outline: none;
}

.empty,
.loading,
.error {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
}

.pixel-ticket {
  width: 72px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 12px, rgba(22, 23, 18, 0.16) 12px 14px, transparent 14px),
    linear-gradient(var(--accent) 0 12px, transparent 12px),
    var(--field);
  box-shadow: 0 10px 24px var(--shadow);
}

h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.preview {
  display: grid;
  gap: 12px;
}

.field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
}

.field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.field strong {
  font-size: 1.02rem;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.4;
  font-weight: 750;
}

.notice.assumptions {
  background: var(--warn-bg);
  color: var(--warn);
}

.notice.missing {
  background: var(--info-bg);
  color: var(--info);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.widget-page {
  min-height: 100vh;
}

.widget-shell {
  width: min(100% - 24px, 440px);
  margin: 0 auto;
  padding: 16px 0;
}

.widget-head {
  margin-bottom: 14px;
}

.widget-page .pixel-calendar {
  width: 36px;
  height: 36px;
  box-shadow: 0 8px 18px var(--shadow);
}

.widget-card {
  display: grid;
  gap: 12px;
}

.widget-composer,
.widget-result {
  min-height: auto;
  box-shadow: 0 10px 24px var(--shadow);
}

.widget-composer {
  padding: 14px;
}

.widget-composer textarea {
  min-height: 180px;
}

.widget-result {
  padding: 14px;
}

.widget-result .empty,
.widget-result .loading,
.widget-result .error {
  min-height: 82px;
}

.widget-result h2 {
  font-size: 1.05rem;
}

.widget-page .result-actions {
  display: grid;
  grid-template-columns: 1fr;
}

@media (prefers-reduced-motion: reduce) {
  button,
  .link-button,
  .topnav a,
  .topnav button {
    transition: none;
  }
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 22px, 1040px);
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    justify-content: flex-start;
  }

  .headline {
    min-height: 150px;
  }

  h1 {
    font-size: 2.85rem;
  }

  textarea {
    min-height: 240px;
  }

  .form-head {
    display: block;
  }

  #meeting-hint {
    display: block;
    margin-bottom: 10px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.35rem;
    line-height: 0.95;
  }

  .topnav a,
  button,
  .link-button {
    min-height: 42px;
  }

  .actions,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
