.ostp-wrap {
  --ostp-bg: #eef1ee;
  --ostp-surface: #ffffff;
  --ostp-surface-2: #e4e9e4;
  --ostp-ink: #1c2620;
  --ostp-muted: #5c6b62;
  --ostp-border: #d8ded9;
  --ostp-accent: #2b6e5e;
  --ostp-accent-ink: #ffffff;
  --ostp-accent-soft: #dcece6;
  --ostp-warm: #b5651d;
  --ostp-warm-soft: #f3e3d3;
  --ostp-shadow: 0 1px 2px rgba(28, 38, 32, 0.06), 0 4px 14px rgba(28, 38, 32, 0.05);
  --ostp-font-display: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --ostp-font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ostp-font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  background: var(--ostp-bg);
  color: var(--ostp-ink);
  font-family: var(--ostp-font-body);
  -webkit-font-smoothing: antialiased;
  margin: -1 * 0px;
  max-width: none;
}
@media (prefers-color-scheme: dark) {
  .ostp-wrap {
    --ostp-bg: #10140f;
    --ostp-surface: #171e19;
    --ostp-surface-2: #1e2620;
    --ostp-ink: #e7eee8;
    --ostp-muted: #93a69c;
    --ostp-border: #2a352e;
    --ostp-accent: #5fbfa0;
    --ostp-accent-ink: #0c1a15;
    --ostp-accent-soft: #1c3129;
    --ostp-warm: #e0954a;
    --ostp-warm-soft: #3a2c1c;
    --ostp-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.35);
  }
}

.ostp-wrap, .ostp-wrap * { box-sizing: border-box; }
.ostp-wrap ::selection { background: var(--ostp-accent-soft); }

.ostp-top {
  position: sticky;
  top: 32px;
  z-index: 20;
  background: var(--ostp-bg);
  border-bottom: 1px solid var(--ostp-border);
  padding: 18px clamp(16px, 4vw, 32px) 14px;
}
.ostp-top-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ostp-brand { display: flex; flex-direction: column; gap: 2px; }
.ostp-eyebrow {
  font-family: var(--ostp-font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ostp-muted);
}
.ostp-brand h1 {
  font-family: var(--ostp-font-display);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 26px);
  margin: 0;
  color: var(--ostp-ink);
  line-height: 1.25;
}

.ostp-instructions {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ostp-muted);
  max-width: 74ch;
}
.ostp-instructions strong { color: var(--ostp-ink); font-weight: 600; }

.ostp-toolbar { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ostp-wrap input[type="text"], .ostp-wrap input[type="search"] {
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--ostp-border);
  background: var(--ostp-surface);
  color: var(--ostp-ink);
}
.ostp-wrap input:focus, .ostp-wrap textarea:focus, .ostp-wrap button:focus-visible {
  outline: 2px solid var(--ostp-accent);
  outline-offset: 1px;
}
#ostp-reviewer-name { width: 220px; }
#ostp-filter-box { width: 260px; flex: 1 1 220px; }

.ostp-wrap button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.ostp-wrap button.ostp-primary { background: var(--ostp-accent); color: var(--ostp-accent-ink); }
.ostp-wrap button.ostp-primary:hover:not(:disabled) { filter: brightness(1.08); }
.ostp-wrap button.ostp-primary:disabled { background: var(--ostp-surface-2); color: var(--ostp-muted); cursor: not-allowed; }
.ostp-wrap button.ostp-ghost { background: transparent; border-color: var(--ostp-border); color: var(--ostp-ink); }
.ostp-wrap button.ostp-ghost:hover:not(:disabled) { background: var(--ostp-surface-2); }
.ostp-wrap button.ostp-ghost:disabled { color: var(--ostp-muted); cursor: not-allowed; }

.ostp-pending-chip {
  font-family: var(--ostp-font-mono);
  font-size: 12px;
  color: var(--ostp-warm);
  background: var(--ostp-warm-soft);
  padding: 4px 10px;
  border-radius: 999px;
  display: none;
}
.ostp-pending-chip.show { display: inline-flex; }

.ostp-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
}
.ostp-locale-nav {
  padding: 20px 10px 40px clamp(16px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 148px;
  align-self: start;
}
.ostp-locale-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px !important;
  border-radius: 8px 2px 2px 8px !important;
  border: 1px solid transparent !important;
  border-right: none !important;
  background: transparent !important;
  text-align: left;
  color: var(--ostp-muted) !important;
  position: relative;
}
.ostp-locale-tab .ostp-name { font-family: var(--ostp-font-display); font-size: 15px; font-weight: 600; color: inherit; }
.ostp-locale-tab .ostp-meta { font-family: var(--ostp-font-mono); font-size: 11px; color: inherit; opacity: 0.85; }
.ostp-locale-tab[aria-selected="true"] {
  background: var(--ostp-surface) !important;
  border-color: var(--ostp-border) !important;
  color: var(--ostp-ink) !important;
  box-shadow: var(--ostp-shadow);
}
.ostp-locale-tab[aria-selected="true"]::after {
  content: ""; position: absolute; right: -1px; top: 0; bottom: 0; width: 3px; background: var(--ostp-accent);
}
.ostp-locale-tab .ostp-badge { font-family: var(--ostp-font-mono); font-size: 10.5px; color: var(--ostp-warm); }

.ostp-main { padding: 20px clamp(16px, 4vw, 32px) 60px 24px; min-width: 0; }
.ostp-locale-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.ostp-locale-heading h2 { font-family: var(--ostp-font-display); font-size: 19px; margin: 0; color: var(--ostp-ink); }
.ostp-sub { font-family: var(--ostp-font-mono); font-size: 12px; color: var(--ostp-muted); }
.ostp-locale-note { font-size: 13px; color: var(--ostp-muted); margin: 4px 0 18px; max-width: 70ch; line-height: 1.5; }

.ostp-cards { display: flex; flex-direction: column; gap: 10px; }
.ostp-card { background: var(--ostp-surface); border: 1px solid var(--ostp-border); border-left: 3px solid var(--ostp-border); border-radius: 10px; padding: 14px 16px 16px; }
.ostp-card.ostp-dirty { border-left-color: var(--ostp-warm); box-shadow: var(--ostp-shadow); }
.ostp-card.ostp-submitted { border-left-color: var(--ostp-accent); }
.ostp-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ostp-context { font-family: var(--ostp-font-mono); font-size: 11px; color: var(--ostp-muted); word-break: break-all; }
.ostp-submitted-tag { font-family: var(--ostp-font-mono); font-size: 10.5px; color: var(--ostp-accent); white-space: nowrap; }

.ostp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
@media (max-width: 640px) { .ostp-pair { grid-template-columns: 1fr; } }
.ostp-field label { display: block; font-family: var(--ostp-font-mono); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ostp-muted); margin-bottom: 4px; }
.ostp-source-text { font-family: var(--ostp-font-mono); font-size: 13px; line-height: 1.5; color: var(--ostp-ink); background: var(--ostp-surface-2); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; }
.ostp-current-text { font-family: var(--ostp-font-display); font-size: 14.5px; line-height: 1.55; color: var(--ostp-ink); padding: 8px 10px; white-space: pre-wrap; }

.ostp-correction-row { border-top: 1px dashed var(--ostp-border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ostp-correction-row label { font-family: var(--ostp-font-mono); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ostp-muted); }
.ostp-wrap textarea.ostp-correction {
  font-family: var(--ostp-font-display);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ostp-ink);
  background: var(--ostp-bg);
  border: 1px solid var(--ostp-border);
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 44px;
  width: 100%;
}
.ostp-wrap textarea.ostp-correction.ostp-edited { border-color: var(--ostp-warm); background: var(--ostp-warm-soft); }
.ostp-note-input { font-size: 12.5px; color: var(--ostp-muted); width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--ostp-border); padding: 4px 2px; }
.ostp-note-input:focus { outline: none !important; border-bottom-color: var(--ostp-accent); }

.ostp-empty { padding: 40px 10px; text-align: center; color: var(--ostp-muted); font-size: 14px; }

.ostp-savebar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--ostp-surface);
  border-top: 1px solid var(--ostp-border);
  padding: 12px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.ostp-savebar-left { margin-right: auto; font-family: var(--ostp-font-mono); font-size: 12px; color: var(--ostp-muted); }

.ostp-toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ostp-ink);
  color: var(--ostp-bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--ostp-font-body);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999999;
}
.ostp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 820px) {
  .ostp-layout { grid-template-columns: 1fr; }
  .ostp-locale-nav { position: static; flex-direction: row; overflow-x: auto; padding: 14px clamp(16px, 4vw, 32px) 6px; gap: 8px; }
  .ostp-locale-tab { border-radius: 8px !important; border-right: 1px solid transparent !important; }
  .ostp-locale-tab[aria-selected="true"]::after { display: none; }
  .ostp-main { padding-left: clamp(16px, 4vw, 32px); }
}
