/* inter-cyrillic-ext-wght-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(./fonts/inter-cyrillic-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* inter-cyrillic-wght-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(./fonts/inter-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* inter-latin-wght-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(./fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f5f7f4;
  --white: #fff;
  --ink: #192d26;
  --text: #263a31;
  --muted: #64726a;
  --line: #dce3dc;
  --subtle: #f1f5f1;
  --accent: #17684b;
  --dark: #142e29;
  --mint: #dcefe2;
  --mono: 'IBM Plex Mono', Consolas, ui-monospace, monospace;
  font-family: Inter, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: default;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
[contenteditable]:focus-visible {
  outline: 3px solid #58a983;
  outline-offset: 2px;
}
button:disabled:hover {
  transform: none;
}
button {
  touch-action: manipulation;
}
input,
select,
textarea {
  min-width: 0;
}
input[type='checkbox'] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
i[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  flex: none;
}
svg {
  display: block;
  flex: none;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  color: var(--ink);
}
h1 {
  font-size: clamp(29px, 2.65vw, 43px);
  font-weight: 660;
  letter-spacing: -0.055em;
  line-height: 1.14;
}
h2 {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.035em;
  font-weight: 650;
}
h3 {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}
small {
  font-size: 12px;
}
b,
strong {
  font-weight: 650;
}
kbd,
code,
.mono {
  font-family: var(--mono);
}
kbd {
  font-size: 11px;
  line-height: 17px;
  background: #f5f6f3;
  border: 1px solid var(--line);
  color: #748177;
  border-radius: 4px;
  min-width: 19px;
  display: inline-flex;
  justify-content: center;
  padding: 0 4px;
}
.layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  height: 100dvh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background: var(--dark);
  color: #c9d6ce;
  padding: 29px 16px 16px;
  z-index: 6;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 1px 10px 29px;
  color: #f5faf6;
  letter-spacing: -0.045em;
  font-weight: 690;
  font-size: 22px;
  line-height: 32px;
  white-space: nowrap;
}
.brand b {
  font-weight: 450;
  color: #d3e2d8;
}
.brand-mark {
  position: relative;
  display: block;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: #afe5b9;
  flex: none;
}
.brand-mark i {
  position: absolute;
  top: 13px;
  left: 9px;
  width: 17px;
  height: 11px;
  border: 2px solid #214738;
  transform: skewY(-18deg);
  border-radius: 1.5px;
  background: #afe5b9;
}
.brand-mark i:nth-child(2) {
  top: 10px;
}
.brand-mark i:nth-child(3) {
  top: 7px;
}
.side-rule {
  height: 1px;
  background: #345047;
  margin: 0 6px 26px;
}
.nav-label {
  padding: 0 13px 10px;
  color: #97b0a2;
  text-transform: uppercase;
  letter-spacing: 0.115em;
  font-size: 10px;
  font-weight: 650;
}
.nav-label.second {
  margin-top: 27px;
}
.navigation a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 13px;
  margin: 3px 0;
  color: #d3ded6;
  font-weight: 510;
  border-radius: 8px;
  min-height: 42px;
}
.navigation a.active {
  color: #edfff1;
  background: #2e5144;
}
.navigation a:hover,
.side-help:hover {
  background: #28463c;
}
.navigation a.active i {
  color: #bcf0c7;
}
.nav-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #758a7f;
  margin-left: auto;
}
.nav-status.on {
  background: #9de3ac;
}
.side-bottom {
  margin-top: auto;
}
.side-help {
  border: 0;
  background: transparent;
  color: #c3d2c9;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  padding: 11px 12px;
  border-radius: 8px;
  width: 100%;
}
.workspace-id {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 17px 3px 0;
  padding: 19px 6px 3px;
  border-top: 1px solid #365047;
}
.workspace-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid #486257;
  background: #2b473b;
  color: #d6ecda;
  font-size: 18px;
  font-weight: 650;
}
.workspace-id strong,
.workspace-id small {
  display: block;
}
.workspace-id strong {
  color: #e8f2eb;
  font-size: 13px;
}
.workspace-id small {
  color: #b2c5b9;
  font-size: 11px;
}
.workspace {
  min-width: 0;
}
.topbar {
  min-height: 61px;
  padding: 0 clamp(20px, 3.2vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.breadcrumbs,
.save-state,
.grid-lang {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.breadcrumbs {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumbs b {
  font-weight: 570;
  color: var(--text);
}
.breadcrumbs > i:first-of-type {
  color: #536e5e;
}
.save-state {
  font-size: 12px;
  color: #627469;
}
.save-state b {
  font-weight: 480;
}
.save-state > span,
.state-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #58a578;
  border-radius: 50%;
  flex: none;
}
.save-state.warn > span {
  background: #b77b28;
}
.menu-toggle,
.scrim {
  display: none !important;
}
main {
  max-width: 1780px;
  margin: 0 auto;
  padding: clamp(25px, 3vw, 47px) clamp(20px, 3.2vw, 60px) 36px;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.page-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.head-actions,
.action-row,
.button-row,
.tool-group,
.history-tools,
.paging,
.title-wrap,
.inline {
  display: flex;
  align-items: center;
  gap: 9px;
}
.head-actions {
  flex: none;
}
.btn,
.icon-btn,
.link-btn,
.strip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 560;
  line-height: 1.25;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.btn {
  border: 1px solid #d3dcd4;
  background: white;
  min-height: 39px;
  padding: 9px 14px;
  font-size: 13px;
}
.btn:not(:disabled):hover,
.icon-btn:not(:disabled):hover {
  background: #f1f5f0;
  border-color: #a8bbb0;
}
.btn.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.btn.primary:not(:disabled):hover {
  background: #11563e;
}
.btn.soft {
  color: var(--accent);
  border-color: #c4dfcb;
  background: #eaf5eb;
}
.btn.danger {
  color: #9d3a26;
}
.compact {
  font-size: 12px;
  min-height: 35px;
  padding: 7px 10px;
}
.icon-btn {
  width: 33px;
  height: 33px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #56675c;
}
.link-btn,
.strip-link {
  background: transparent;
  border: 0;
  color: var(--accent);
  padding: 2px 0;
  font-size: 13px;
}
.link-btn:hover,
.strip-link:hover {
  text-decoration: underline;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 23px;
}
.source-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.source-card.dragging {
  border-color: #367c58;
  background: #eaf6eb;
  outline: 2px dashed #7ca98a;
  outline-offset: -5px;
}
.file-mark {
  width: 45px;
  height: 51px;
  position: relative;
  display: grid;
  place-items: center;
  background: #e7eef9;
  color: #4d6e9f;
  border: 1px solid #cfdbec;
  border-radius: 6px 11px 6px 6px;
  flex: none;
  clip-path: polygon(0 0, 73% 0, 100% 24%, 100% 100%, 0 100%);
}
.file-mark:before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 12px;
  height: 12px;
  background: #c9d9ef;
  border-radius: 0 0 0 3px;
}
.file-mark.ua {
  background: #fff2ce;
  color: #8b6b1c;
  border-color: #ebddaa;
}
.file-mark.ua:before {
  background: #f1dc9c;
}
.file-mark b {
  font: 700 14px/1 var(--mono);
  margin-top: 5px;
}
.source-text {
  min-width: 0;
  flex: 1;
}
.source-text h3 {
  font-size: 16px;
}
.source-text p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.source-action {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fafcf9;
  color: #4a6857;
}
.source-action:hover {
  background: #e9f2e9;
}
.source-card.loaded {
  border-color: #c9d9cb;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.panel-top,
.toolbar,
.grid-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.panel-top {
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.title-icon {
  color: #4d6956;
  display: grid;
  place-items: center;
}
.title-wrap {
  gap: 10px;
  min-width: 0;
}
.count-pill {
  font: 550 11px/17px var(--mono);
  padding: 0 6px;
  border-radius: 5px;
  background: #eff3ef;
  border: 1px solid #dce4dc;
  color: #627365;
}
.segments {
  display: inline-flex;
  align-items: center;
  background: #f1f4f0;
  border: 1px solid #dce3dc;
  padding: 3px;
  border-radius: 8px;
  flex: none;
  gap: 1px;
}
.segments button {
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #53665b;
  font-size: 12px;
  font-weight: 570;
  padding: 4px 10px;
  min-height: 26px;
}
.segments button.active {
  border-color: #d2dcd3;
  background: white;
  color: #175f43;
  box-shadow: 0 1px 2px #1c302317;
}
.toolbar {
  padding: 12px 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fafbf9;
  border: 1px solid #dce3dc;
  border-radius: 8px;
  padding: 6px 9px;
  color: #758579;
  min-height: 35px;
  flex: 1;
  max-width: 375px;
  min-width: 150px;
}
.search input {
  outline: 0 !important;
  border: 0;
  background: transparent;
  width: 100%;
  font-size: 12px;
  line-height: 20px;
}
.search:focus-within {
  outline: 2px solid #83b894;
}
.search kbd {
  margin-left: auto;
}
.tool-group {
  gap: 7px;
}
.history-tools {
  gap: 0;
  border-left: 1px solid var(--line);
  padding-left: 6px;
}
.history-tools button:disabled {
  opacity: 0.36;
}
.empty-grid {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 22px 14px 24px;
  background-image: radial-gradient(#e1e8de 0.8px, transparent 0.8px);
  background-size: 15px 15px;
  position: relative;
}
.empty-grid:before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #ffffffee 5%, #ffffff76 43%, #ffffff0f 98%);
  pointer-events: none;
}
.empty-content {
  position: relative;
  text-align: center;
}
.empty-content h3 {
  font-size: 21px;
  letter-spacing: -0.045em;
}
.empty-content p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.sample-btn {
  margin-top: 14px;
  min-height: 33px;
  padding: 7px 12px;
  font-size: 12px;
  color: #35634a;
}
.art {
  position: relative;
  width: 100px;
  height: 74px;
  margin: 0 auto 12px;
}
.art-back,
.art-sheet {
  position: absolute;
  border: 1.5px solid #8ba897;
  border-radius: 6px;
}
.art-back {
  width: 65px;
  height: 47px;
  left: 12px;
  top: 10px;
  transform: rotate(-12deg);
  background: repeating-linear-gradient(0deg, #e0ebdf 0 7px, #cadbc9 7px 8px);
}
.art-sheet {
  width: 68px;
  height: 51px;
  left: 22px;
  top: 16px;
  background: #fff;
  transform: rotate(6deg);
  overflow: hidden;
  box-shadow: 0 3px 0 #dae5d8;
}
.art-top {
  height: 12px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  background: #cbe1cf;
  border-bottom: 1px solid #99b5a0;
}
.art-top i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #739b7b;
}
.art-grid {
  position: absolute;
  inset: 17px 7px 7px;
  background:
    repeating-linear-gradient(90deg, transparent 0 15px, #d5e0d4 15px 16px),
    repeating-linear-gradient(0deg, transparent 0 7px, #d5e0d4 7px 8px);
  border: 1px solid #d3dfd4;
}
.art-plus {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 25px;
  height: 25px;
  background: #22724f;
  border: 3px solid white;
  border-radius: 8px;
  color: white;
  font: 500 20px/18px Arial;
}
.grid-foot {
  padding: 9px 17px;
  min-height: 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}
.grid-status {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.grid-status .link-btn {
  font-size: 11px;
}
.grid-lang {
  font-size: 11px;
  gap: 5px;
}
.paging {
  gap: 4px;
}
.paging select {
  font-size: 11px;
  padding: 3px;
  border: 0;
  background: transparent;
}
.paging .icon-btn {
  height: 25px;
  width: 25px;
}
#page-label {
  font-variant-numeric: tabular-nums;
}
.assistant-strip {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 19px;
  padding: 19px 20px;
  background: #eaf2e9;
  border: 1px solid #d6e3d4;
  border-radius: 12px;
}
.assistant-icon {
  flex: none;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  background: #d8e8d8;
  color: #447857;
  border-radius: 10px;
}
.assistant-strip h3 {
  font-size: 15px;
}
.assistant-strip p {
  color: #556e5c;
  font-size: 12px;
  margin-top: 2px;
}
.strip-link {
  margin-left: auto;
  flex: none;
  color: #2d6142;
  font-size: 12px;
}
.pop-wrap {
  position: relative;
}
.popover {
  position: absolute;
  top: calc(100% + 6px);
  background: #fff;
  z-index: 5;
  min-width: 190px;
  max-width: min(310px, 86vw);
  max-height: 42vh;
  overflow: auto;
  box-shadow: 0 8px 28px #1736251c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px;
}
.align-right {
  right: 0;
}
.popover button,
.popover label {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: 5px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.popover button:hover,
.popover label:hover {
  background: var(--subtle);
}
.formula {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  min-height: 34px;
  color: var(--muted);
}
.formula > input,
.formula > textarea {
  background: transparent;
  border: 0;
  padding: 5px 9px;
  font: 12px/19px var(--mono);
  color: var(--text);
}
.formula > input {
  width: 64px;
  text-align: center;
  border-right: 1px solid var(--line);
  flex: none;
}
.formula > span {
  margin: 0 3px 0 10px;
  font: italic 15px Georgia;
  color: #748d78;
}
.formula > span span {
  font-size: 11px;
}
.formula > textarea {
  flex: 1;
  resize: vertical;
  min-height: 30px;
  max-height: 100px;
}
.formula .icon-btn {
  margin-right: 5px;
}
.sheet {
  overflow: auto;
  max-height: 58vh;
  min-height: 150px;
  position: relative;
  overscroll-behavior-inline: contain;
}
.sheet table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 100%;
  width: max-content;
  font-size: 12px;
}
.sheet th,
.sheet td {
  border-right: 1px solid #e4e9e2;
  border-bottom: 1px solid #e4e9e2;
  padding: 0;
  position: relative;
  text-align: left;
  font-weight: 400;
  vertical-align: top;
}
.sheet th {
  position: sticky;
  top: 0;
  background: #f3f6f2;
  z-index: 2;
  font-weight: 600;
  height: 42px;
}
.sheet th:first-child,
.sheet td:first-child {
  position: sticky;
  left: 0;
  background: #f8faf6;
  z-index: 1;
  text-align: center;
  color: #778579;
}
.sheet th:first-child {
  z-index: 3;
  background: #f0f4ed;
}
.sheet th > button {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  padding: 5px 9px;
  text-align: left;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 650;
}
.sheet th > button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet th small {
  font-size: 9px;
  color: #67766b;
  font-family: var(--mono);
}
.sheet .letter {
  color: #89988b;
  font: 10px var(--mono);
}
.sheet .lang-tag,
.lang-tag {
  font: 600 10px/17px var(--mono);
  display: inline-block;
  padding: 0 5px;
  color: #456b95;
  background: #e9f0fa;
  border-radius: 4px;
}
.lang-tag.ua,
.sheet .lang-tag.ua {
  color: #846321;
  background: #faf1d7;
}
.sheet th .lang-tag {
  margin-left: auto;
}
.row-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  min-height: 33px;
  font: 10px var(--mono);
}
.row-select input {
  width: 13px;
  height: 13px;
}
.cell {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 7px 9px;
  line-height: 1.45;
  min-height: 31px;
}
.sheet td.editable {
  cursor: cell;
}
.sheet td.edited:before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  border-top: 7px solid #4c9569;
  border-left: 7px solid transparent;
}
.sheet td.selected {
  background: #e8f3e9;
}
.sheet td.focused {
  outline: 2px solid #4b8e68;
  outline-offset: -2px;
}
.sheet td.missing {
  color: #97a198;
  background: #f6f7f4;
  text-align: center;
  vertical-align: middle;
}
.resize-col,
.resize-row,
.fill-grip {
  position: absolute;
  z-index: 3;
  touch-action: none;
}
.resize-col {
  right: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  cursor: col-resize;
}
.resize-row {
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  cursor: row-resize;
}
.fill-grip {
  right: 0;
  bottom: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border: 1px solid white;
  cursor: crosshair;
}
.cell-input {
  width: 100%;
  min-height: 48px;
  padding: 5px 8px;
  font-size: 12px;
  resize: vertical;
  border: 2px solid #55956e;
  background: white;
}
.sheet .checked td:first-child {
  background: #dfeddf;
}
dialog {
  width: min(540px, calc(100vw - 24px));
  max-height: 88dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 22px 70px #122f2542;
  color: var(--text);
  background: white;
}
dialog.wide {
  width: min(910px, calc(100vw - 24px));
}
dialog::backdrop {
  background: #152b22a1;
}
.dialog-head,
.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 20px;
}
.dialog-head {
  border-bottom: 1px solid var(--line);
}
.dialog-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.dialog-head h2 {
  font-size: 19px;
}
#dialog-body {
  padding: 19px 20px;
  max-height: calc(85dvh - 137px);
  overflow: auto;
}
.dialog-copy,
.helper {
  color: var(--muted);
  font-size: 13px;
}
.dialog-copy {
  line-height: 1.6;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 21px;
  z-index: 12;
  background: #193b2b;
  color: #fff;
  border-radius: 10px;
  padding: 12px 17px;
  font-size: 13px;
  max-width: min(440px, calc(100vw - 32px));
  box-shadow: 0 4px 15px #172f211a;
}
.skip {
  position: fixed;
  top: -80px;
  left: 10px;
  z-index: 15;
  background: white;
  padding: 10px;
}
.skip:focus {
  top: 5px;
}
.stack {
  display: grid;
  gap: 14px;
}
.section-pad {
  padding: 22px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}
.section-heading h2 {
  font-size: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field-label {
  font-size: 12px;
  font-weight: 650;
}
.field input:not([type='checkbox']),
.field select,
.field textarea,
.text-area,
.control {
  background: #fff;
  border: 1px solid #ccd7ce;
  border-radius: 7px;
  padding: 8px 10px;
  width: 100%;
  font-size: 13px;
}
.field textarea,
.text-area {
  resize: vertical;
  min-height: 75px;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #75a484;
}
.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.actions-wrap,
.button-row {
  flex-wrap: wrap;
}
.actions-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
}
.inline-check input {
  flex: none;
}
.small-note {
  color: var(--muted);
  font-size: 12px;
}
.notice,
.error-box {
  background: #fff4d9;
  color: #6e5323;
  border: 1px solid #ecddb0;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 13px;
}
.notice {
  margin-bottom: 12px;
}
.error-box {
  background: #fff3ed;
  border-color: #efd3c3;
  color: #853e24;
}
.good {
  color: #246949;
}
.preview-box,
.code-area {
  font: 12px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.preview-box {
  border: 1px solid var(--line);
  background: #f7f9f6;
  border-radius: 8px;
  padding: 13px;
  max-height: 260px;
  overflow: auto;
}
.visual-area,
.code-area {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 185px;
  width: 100%;
  overflow-wrap: anywhere;
}
.code-area {
  resize: vertical;
}
.visual-area {
  max-height: 46vh;
  overflow: auto;
}
.visual-area p {
  margin: 0.5em 0;
}
.editor-tools {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.editor-tools button {
  padding: 4px 7px;
  min-height: 26px;
  font-size: 11px;
}
.editor-box {
  min-width: 0;
}
.editor-box .segments {
  margin: 7px 0;
}
.ref-list {
  max-height: 55vh;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.ref-item {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid #ebeeea;
  padding: 5px 2px;
  min-height: 41px;
}
.ref-item.selected {
  background: #edf5ed;
}
.ref-item .ref-name {
  flex: 1;
  background: none;
  border: 0;
  text-align: left;
  padding: 5px 9px;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.ref-item .icon-btn {
  width: 30px;
  height: 29px;
}
.ref-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(235px, 1fr);
  gap: 16px;
  align-items: start;
}
.ref-item span.ref-name {
  display: block;
}
.stretch {
  flex: 1;
  min-width: 100px;
}
details summary {
  cursor: pointer;
  font-weight: 620;
  font-size: 13px;
}
details[open] summary {
  margin-bottom: 10px;
}
.muted {
  color: var(--muted);
}
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.switch {
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 580;
}
.switch input {
  appearance: none;
  margin: 0;
  width: 34px;
  height: 20px;
  border-radius: 12px;
  background: #b6c2b8;
  position: relative;
  flex: none;
}
.switch input:before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  background: #fff;
  transition: transform 0.14s;
}
.switch input:checked {
  background: var(--accent);
}
.switch input:checked:before {
  transform: translateX(14px);
}
.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(265px, 0.85fr);
  gap: 16px;
  align-items: start;
}
.ai-sidebar {
  position: sticky;
  top: 16px;
}
.card-note {
  font-size: 13px;
  color: var(--muted);
  margin: 5px 0 15px;
}
.rule {
  border-top: 1px solid var(--line);
  padding: 15px 0 0;
}
.rule + .rule {
  margin-top: 14px;
}
.rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.field-key {
  font: 11px var(--mono);
  color: #697a6d;
  margin-left: 6px;
}
.rule textarea {
  min-height: 65px;
}
.ai-results {
  margin-top: 18px;
}
.progress {
  width: 100%;
  accent-color: var(--accent);
  height: 9px;
}
.proposal {
  border-top: 1px solid var(--line);
  padding: 13px 0;
}
.proposal > label {
  font-size: 13px;
  font-weight: 600;
}
.proposal .two-up {
  margin-top: 9px;
  gap: 8px;
}
.proposal pre {
  margin: 4px 0 0;
  padding: 9px 11px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: #f4f5f2;
  font: 12px/1.5 var(--mono);
}
.proposal .after {
  background: #eaf4e9;
}
.chip {
  font-size: 11px;
  color: #49674e;
  background: #eaf2e9;
  border-radius: 5px;
  padding: 3px 7px;
}
.ex-list {
  padding-left: 18px;
  margin: 6px 0;
  font-size: 12px;
}
.error-summary {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.load-choice {
  width: 100%;
  justify-content: flex-start;
  min-height: 50px;
}
.load-choice span {
  display: block;
}
.rule-set {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
@media (min-width: 1550px) {
  .layout {
    grid-template-columns: 248px minmax(0, 1fr);
  }
  .empty-grid {
    min-height: 345px;
  }
}
@media (max-width: 1150px) {
  .layout {
    grid-template-columns: 192px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 12px;
    padding-right: 12px;
  }
  .brand {
    font-size: 20px;
    gap: 8px;
  }
  .page-head {
    align-items: flex-start;
  }
  .source-card {
    padding: 15px;
    gap: 10px;
  }
  .ai-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  }
}
@media (max-width: 900px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 232px;
    transform: translateX(-100%);
    visibility: hidden;
    transition:
      transform 0.15s,
      visibility 0.15s;
  }
  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .scrim:not([hidden]) {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 5;
    background: #1d362894;
    border: 0;
  }
  .menu-toggle {
    display: inline-flex !important;
  }
  .topbar {
    min-height: 51px;
  }
  .breadcrumbs {
    gap: 7px;
  }
  .breadcrumbs > i:first-of-type {
    display: none;
  }
  .side-rule {
    margin-bottom: 19px;
  }
  .page-head {
    align-items: center;
  }
}
@media (max-width: 680px) {
  main {
    padding: 21px 12px 27px;
  }
  .topbar {
    padding: 0 10px;
  }
  .page-head {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-head p {
    font-size: 13px;
    margin-top: 5px;
  }
  .head-actions .btn {
    min-height: 35px;
  }
  .source-grid {
    gap: 7px;
    margin-bottom: 13px;
  }
  .source-card {
    min-height: 78px;
    padding: 10px 8px;
    gap: 7px;
  }
  .file-mark {
    width: 29px;
    height: 35px;
    border-radius: 4px;
  }
  .file-mark:before {
    width: 8px;
    height: 8px;
  }
  .file-mark b {
    font-size: 10px;
  }
  .source-text h3 {
    font-size: 13px;
  }
  .source-text p {
    font-size: 10px;
    margin-top: 2px;
  }
  .source-action {
    width: 27px;
    height: 29px;
  }
  .source-action svg {
    width: 14px;
  }
  .panel-top {
    padding: 12px 10px;
    gap: 6px;
  }
  .title-wrap {
    gap: 5px;
  }
  .title-wrap h2 {
    font-size: 16px;
  }
  .title-icon {
    display: none;
  }
  .segments {
    padding: 2px;
  }
  .segments button {
    padding: 3px 7px;
    font-size: 11px;
  }
  .toolbar {
    padding: 9px;
    gap: 7px;
  }
  .search {
    max-width: none;
  }
  .tool-group {
    gap: 3px;
  }
  .tool-group .compact {
    padding: 6px;
    min-height: 31px;
  }
  .tool-group .compact span {
    display: none;
  }
  .history-tools {
    padding-left: 2px;
  }
  .history-tools .icon-btn {
    width: 25px;
  }
  .search kbd {
    display: none;
  }
  .empty-grid {
    min-height: 266px;
  }
  .grid-foot {
    padding: 8px 10px;
  }
  .assistant-strip {
    padding: 12px 10px;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 13px;
  }
  .assistant-strip p {
    font-size: 11px;
  }
  .strip-link {
    font-size: 11px;
  }
  .section-pad {
    padding: 15px;
  }
  .ref-main,
  .ai-layout,
  .two-up {
    grid-template-columns: minmax(0, 1fr);
  }
  .ai-sidebar {
    position: static;
  }
  .dialog-head,
  .dialog-foot,
  #dialog-body {
    padding: 13px;
  }
  .source-text {
    min-width: 0;
  }
  .grid-status {
    gap: 7px;
  }
  .breadcrumbs {
    font-size: 11px;
  }
  .save-state {
    font-size: 10px;
  }
  .panel {
    border-radius: 10px;
  }
}
@media (max-width: 420px) {
  .source-text h3 {
    font-size: 12px;
  }
  .source-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 4px;
  }
  .file-mark {
    width: 23px;
    height: 30px;
  }
  .source-text p {
    max-width: 88px;
  }
  .source-action {
    border: 0;
    width: 21px;
    background: transparent;
  }
  .assistant-strip {
    display: grid;
    grid-template-columns: 34px 1fr;
  }
  .assistant-icon {
    width: 32px;
    height: 32px;
    grid-row: span 2;
  }
  .strip-link {
    margin: 0;
    justify-self: start;
  }
  .search {
    min-width: 117px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
