:root {
  --color-cyan: #00FFFF;
  --color-coral: #E07060;
  --color-yellow: #FFFF00;
  --color-green: #00FF00;
  --color-magenta: #FF00FF;
  --color-peach: #fff1e5;
  --color-cream: #FDFDF8;
  --bg: var(--color-cream);
  --yellow: #FFFF00;
  --black: #151922;
  --surface: var(--color-cream);
  --card: var(--color-cream);
  --border: #000000;
  --border-dark: #000000;
  --text: var(--black);
  --muted: #000000;
  --accent: #000000;
  --font-display: 'Public Sans', Arial Narrow, sans-serif;
  --font-sans: 'Public Sans', Arial Narrow, sans-serif;
  --c-fl: #000;
  --c-ll: #000;
  --c-c: #000;
  --c-lr: #000;
  --c-fr: #000;
  --border-radius: 12px;
  --sp_sm: 5px;
  --sp_md: 10px;
  --sp_lg: 20px;
  --sp_xl: 40px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  color: var(--black);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 1rem;
}

a {
  color: var(--text);
  text-decoration: underline;
  font-weight: 500;
}
a:hover {
  text-decoration: none;
}

p {
  font-size: 1rem;
  line-height: 1.5;
}

ul li {
  list-style: disc;
  margin: 0 0 0.5rem 1rem;
}

.title-icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  display: inline-block;
}

.app {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 0 1rem;
}

.section-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.center_wrapper {
  width: 100%;
  text-align: center;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

h2, h3 {
  font-size: 1rem;
  line-height: 1rem;
  display: inline-block;
  padding: 0.65rem 0.8rem;
  margin: 0 0 0.5rem;
  align-self: flex-start;
  background: repeating-linear-gradient(-45deg, var(--black), var(--black) 0.5px, transparent 2px, transparent 4px);
}
h2 span, h3 span {
  background-color: var(--bg);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  padding: 0.125rem 0.25rem;
}

h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

footer {
  margin: 0 0 1rem 0;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8rem;
}

input[type=text],
input[type=email] {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  outline: none;
  transition: border-color 0.15s;
}

button {
  display: inline-block;
  background: var(--black);
  color: var(--bg);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  padding: 0.75rem 1.5rem;
}

button.icon {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 2px 0 0 5px;
  text-align: center;
}

.button:hover {
  opacity: 0.82;
}

fieldset {
  border: 1px dashed var(--black);
  padding: var(--sp_lg);
}

legend {
  background-image: radial-gradient(circle, var(--black) 45%, transparent 45%);
  background-size: 4px 4px;
  padding: 0.5rem 0.75rem;
  margin: 0 auto;
}
legend span {
  background-color: var(--bg);
  padding: 0.1rem 0.2rem;
  font-weight: 700;
}

input::placeholder {
  font-style: italic;
  color: var(--black);
}

.newsletter-check-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  cursor: pointer;
  flex-basis: 100%;
}

.masthead {
  padding: 0;
  margin: 0;
  margin-bottom: 0.75rem;
  text-align: left;
}
.masthead .masthead-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}
.masthead .masthead-top img.logo {
  width: 150px;
}
.masthead .masthead-top nav {
  margin: 1rem 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, auto);
  grid-gap: var(--sp_lg);
  align-items: center;
}
.masthead .masthead-top nav .masthead-circle {
  width: 1.5rem;
  height: 1.5rem;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.masthead .masthead-bottom .masthead-sub {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}

.masthead-link {
  text-decoration: none;
}

.tin-can-img {
  display: block;
  width: 60%;
  max-width: 320px;
  margin: 1.5rem auto;
  mix-blend-mode: multiply;
}

.masthead-actions {
  position: absolute;
  top: 1.1rem;
  right: 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.masthead-share {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.masthead-share .material-symbols-outlined {
  font-size: 1.5rem;
}

.masthead-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
}
.masthead-close .material-symbols-outlined {
  font-size: 2rem;
}
.masthead-close:hover {
  opacity: 1;
}

.masthead-eyebrow {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.masthead-copy {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0;
  transition: color 0.15s;
}

.masthead h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 0;
  width: 85%;
}

.color-picker {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 50;
}
.color-picker.open {
  display: flex;
}

.color-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--black);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.1s;
}
.color-swatch:hover {
  transform: scale(1.15);
}

.color-picker-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.color-picker-close:hover {
  opacity: 1;
}
.color-picker-close img {
  width: 1.25rem;
  height: 1.25rem;
}

.slider-wrap {
  margin-top: 0.75rem;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.slider-label-left,
.slider-label-right {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000;
}

input[type=range].spectrum-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: #000;
  outline: none;
  border: none;
  cursor: pointer;
  border-radius: 0;
  display: block;
}
input[type=range].spectrum-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #000;
  border: none;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.1s;
}
input[type=range].spectrum-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}
input[type=range].spectrum-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #000;
  border: none;
  box-shadow: none;
  cursor: pointer;
}
input[type=range].spectrum-slider::-moz-range-track {
  height: 3px;
  background: #000;
  border: none;
}

.mode-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: #000;
  outline: none;
  border: none;
  cursor: pointer;
  border-radius: 0;
  display: block;
}
.mode-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #000;
  border: none;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.1s;
}
.mode-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}
.mode-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #000;
  border: none;
  box-shadow: none;
  cursor: pointer;
}
.mode-slider::-moz-range-track {
  height: 3px;
  background: #000;
  border: none;
}

.mode-converse {
  color: #000 !important;
}

.mode-avoid {
  color: #000 !important;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  margin-top: 6px;
}
.slider-ticks span {
  width: 1px;
  height: 7px;
  background: var(--border-dark);
  opacity: 1;
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.loading-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.loading-overlay p {
  font-size: 0.95rem;
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--muted);
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--border-dark);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.card-subtitle {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 1rem;
}

.auth-panel {
  margin: 2rem 0 0;
}
.auth-panel #authSignIn {
  display: block;
}
.auth-panel #authUserPanel {
  display: none;
}
.auth-panel .auth-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.auth-panel .auth-status {
  font-size: 0.85rem;
  margin-top: 0.6rem;
  font-style: italic;
}
.auth-panel .auth-status.error {
  color: var(--accent);
  font-style: normal;
}
.auth-panel .auth-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0;
}
.auth-panel .auth-user-row .card-subtitle {
  margin-bottom: 0;
}
.auth-panel .auth-user-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.auth-panel .auth-user-actions button {
  background: none;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s;
}
.auth-panel .auth-user-actions button:hover {
  color: var(--text);
}

.briefing-list {
  margin-top: 1rem;
}

.briefing-list-empty {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}

.briefing-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
}

.briefing-list-link {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}
.briefing-list-link:hover {
  text-decoration-color: var(--text);
}

.kebab-wrap {
  position: relative;
  flex-shrink: 0;
}

.kebab-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-family: var(--font-sans);
  transition: color 0.15s;
}
.kebab-btn:hover {
  color: var(--text);
}

.kebab-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 20;
  min-width: 130px;
}
.kebab-menu.open {
  display: block;
}

.kebab-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.85rem;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}
.kebab-item:hover {
  background: var(--bg);
}
.kebab-item.danger {
  color: var(--accent);
}

.rename-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 237, 255, 0.92);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 50;
  align-items: center;
  justify-content: center;
}
.rename-overlay.visible {
  display: flex;
}

.rename-dialog {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  padding: 1.75rem;
  width: min(480px, 100vw - 2.5rem);
}
.rename-dialog .section-label {
  margin-bottom: 1rem;
}

.rename-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.15s;
}
.rename-input:focus {
  border-color: var(--border-dark);
}

.rename-actions {
  display: flex;
  gap: 0.75rem;
}

.rename-save-btn {
  padding: 0.5rem 1.25rem;
  background: var(--border-dark);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: opacity 0.15s;
}
.rename-save-btn:hover {
  opacity: 0.82;
}

.rename-cancel-btn {
  padding: 0.5rem 1.25rem;
  background: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color 0.15s, color 0.15s;
}
.rename-cancel-btn:hover {
  border-color: var(--border-dark);
  color: var(--text);
}

.form-panel {
  background: transparent;
  border-radius: 0;
  padding: 0.5rem 0;
  margin: 0 auto 2rem;
}

.selector-section {
  background: transparent;
  border-radius: 0;
  padding: 1.25rem 0 1rem;
}
.selector-section + .selector-section {
  margin-top: 0;
}
.selector-section > .field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.field-who-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.field-who-row .field-who {
  margin-bottom: 0;
}

.country-select {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  appearance: auto;
}
.country-select:focus {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

.field-who {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.75rem;
}

.options-section {
  margin-top: 1.5rem;
  width: 100%;
}

.options-end-divider {
  display: none;
}

.generate-btn {
  margin: 1.75rem auto 0;
  padding: 0.75rem 1.5rem;
  font-size: 1.25rem;
}
.generate-btn:hover {
  opacity: 0.82;
}
.generate-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.error-box {
  display: none;
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  background: #fdf3f2;
  color: #8b1a1a;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}
.error-box.visible {
  display: block;
}

.tinfoil-row {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 0 1rem;
  cursor: pointer;
  user-select: none;
}
.tinfoil-row input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.tinfoil-row input:checked ~ .toggle-track {
  background: var(--accent);
}
.tinfoil-row input:checked ~ .toggle-track::before {
  transform: translateX(22px);
}
.tinfoil-row .tinfoil-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.tinfoil-row .tinfoil-icon {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
}
.tinfoil-row .tinfoil-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.tinfoil-row .tinfoil-sub {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.tinfoil-row .toggle-track {
  position: relative;
  width: 50px;
  height: 28px;
  border: 1px solid var(--black);
  border-radius: 14px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.tinfoil-row .toggle-track::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 2px;
  background: #fff;
  border: 1px solid var(--black);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
