:root {
  --page-bg: #f2f2f2;
  --chrome-bg: #2d2d2d;
  --line: #d7d7d7;
  --text: #222222;
  --toolbar-text: rgba(245, 245, 247, 0.86);
  --toolbar-font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --muted: #7c7c7c;
  --accent: #f5c84c;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.75rem;
  padding: 0.18rem clamp(0.6rem, 1.5vw, 0.85rem);
  color: var(--toolbar-text);
  background: var(--chrome-bg);
  font-family: var(--toolbar-font);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  border-radius: 0.25rem;
  color: #fff;
  background: #555;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--toolbar-text);
  font-size: 0.72rem;
  font-weight: 400;
}

input[type="color"] {
  width: 1.55rem;
  height: 1.25rem;
  padding: 0.1rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: #fff;
  cursor: pointer;
}

select,
button {
  min-height: 1.35rem;
  border: 1px solid #555;
  border-radius: 0.25rem;
  background: #3b3b3b;
  color: var(--toolbar-text);
  font: inherit;
  font-size: 0.72rem;
}

select {
  padding: 0 0.35rem;
}

button {
  padding: 0 0.55rem;
  color: #222;
  background: var(--accent);
  border-color: var(--accent);
  cursor: pointer;
}

button:hover {
  filter: brightness(0.96);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.45rem;
  flex: 1;
  min-height: calc(100vh - 7rem);
  padding: 0;
  background: var(--page-bg);
}

.panel {
  display: flex;
  min-height: calc(100vh - 7rem);
  overflow: hidden;
  flex-direction: column;
  background: var(--editor-bg, #fffaf0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.52);
}

h1,
h2 {
  margin: 0;
  font-size: 0.9rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

textarea,
pre {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.6rem 4vw;
  border: 0;
  outline: none;
  color: var(--editor-fg, #1f2937);
  background: var(--editor-bg, #fffaf0);
  font-family: var(--editor-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 1rem;
  line-height: 1.65;
}

textarea {
  resize: none;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .workspace {
    grid-template-columns: 1fr;
  }
}

.privacy-badge {
  flex: 1;
  color: #f8e6a0;
  font-size: 0.72rem;
  text-align: center;
  white-space: nowrap;
}

.site-footer {
  border-top: 1px solid #c9d1dc;
  padding: 1.8rem 1rem 1.35rem;
  background: #f5f6f8;
  color: #050505;
  font-size: clamp(1rem, 1.7vw, 1.55rem);
  line-height: 1.35;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.footer-nav a {
  color: #155bd5;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus {
  text-decoration: underline;
}

.info-page {
  display: grid;
  min-height: calc(100vh - 6rem);
  place-items: start center;
  padding: clamp(1.5rem, 5vw, 4rem) 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f2 100%);
}

.info-card {
  width: min(920px, 100%);
  padding: clamp(1.25rem, 4vw, 3rem);
  border: 1px solid #d8dee8;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 1rem 2.5rem rgba(17, 24, 39, 0.08);
}

.info-card h1 {
  margin: 0 0 1rem;
  color: #111827;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -0.04em;
}

.info-card h2 {
  margin: 1.5rem 0 0.45rem;
  color: #1f2937;
  font-size: clamp(1.2rem, 2.3vw, 1.65rem);
}

.info-card p,
.info-card li {
  color: #374151;
  font-size: 1.05rem;
  line-height: 1.75;
}

.info-card ul {
  padding-left: 1.35rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: #155bd5;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus {
  text-decoration: underline;
}

.privacy-callout {
  border-left: 0.35rem solid var(--accent);
  padding: 1rem 1.15rem;
  border-radius: 0.4rem;
  background: #fff8db;
}

.scope-list {
  list-style: none;
  padding-left: 0;
}

@media (max-width: 820px) {
  .privacy-badge {
    flex: initial;
    text-align: left;
  }

  .site-footer {
    font-size: 1rem;
  }
}
