.document-main {
  max-width: 1192px;
  margin: 30px auto 70px;
  padding: 0 44px;
}
.tool-title {
  max-width: 760px;
  margin-bottom: 42px;
}
.tool-title h1 {
  font-size: 46px;
  letter-spacing: -1.6px;
  line-height: 1.12;
}
.tool-title > p:not(.eyebrow) {
  font-size: 15px;
  color: var(--muted);
  max-width: 620px;
}
.editor-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 42px;
  align-items: start;
}
.editor-panel {
  min-width: 0;
}
fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
  margin: 0 0 24px;
}
legend {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  width: 100%;
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
  margin-bottom: 18px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 16px;
}
input:not([type='checkbox']):not([type='range']),
select,
textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 47px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  padding: 12px;
  margin-top: 7px;
  outline-offset: 2px;
  font-size: 14px;
  max-width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--focus);
}
input[readonly] {
  background: var(--soft) !important;
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.field-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  font-weight: 400;
  margin-top: 0;
}
.month-choice {
  background: var(--soft);
  padding: 13px 14px;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 500;
}
.month-choice input {
  width: 19px;
  height: 19px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.tool-error {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}
.tool-error:empty {
  display: none;
}
.result-status {
  font-size: 13px;
  color: var(--success-text);
  line-height: 1.7;
}
.preview-panel {
  position: sticky;
  top: 22px;
  min-width: 0;
}
.preview-top {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.1px;
  color: var(--muted);
  margin: 0 0 15px;
}
.paper-preview {
  padding: 34px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 10px 35px #092c6008;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.paper-brand {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--success);
  font-weight: 700;
  margin-bottom: 25px;
}
.paper-preview h2 {
  font-size: 19px;
  letter-spacing: 0;
  line-height: 1.3;
  margin-bottom: 22px;
}
.paper-preview h3 {
  font-size: 13px;
  color: var(--success-text);
  margin: 22px 0 9px;
}
.paper-preview p {
  font-size: 11px;
  line-height: 1.9;
  margin: 5px 0;
}
.paper-notice {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
}
.local-note {
  margin: 22px 0 12px;
  display: flex;
  gap: 11px;
  align-items: start;
}
.local-note svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--success);
}
.local-note p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}
.next-tool {
  display: block;
  font-size: 12px;
  color: var(--primary);
  margin-top: 25px;
}
.download-again {
  display: block;
  color: var(--primary);
  font-size: 13px;
  text-decoration: underline;
  margin: 12px 0;
}
.document-footer {
  max-width: 1104px;
  margin: auto;
  padding: 25px 0 35px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
}
.document-footer a {
  color: var(--primary);
}
.room {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 14px;
}
.room-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.room h3 {
  margin: 0 0 14px;
  font-size: 17px;
}
.quiet {
  background: none;
  border: 0;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  padding: 10px 0;
}
.summary-card {
  padding: 25px;
  background: var(--soft);
  border-radius: 20px;
  margin-bottom: 18px;
}
.summary-card h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
}
.summary-total {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 15px 0;
}
.summary-total small {
  font-size: 17px;
}
.budget-line {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.budget-line:last-child {
  border-bottom: 0;
}
.budget-meter {
  height: 10px;
  border-radius: 10px;
  background: #dce8f5;
  overflow: hidden;
  margin: 18px 0;
}
.budget-meter > span {
  display: block;
  height: 100%;
  background: var(--primary);
  max-width: 100%;
  transition: width 0.2s;
}
.attestation {
  display: flex;
  gap: 12px;
  align-items: start;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
}
.attestation input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.back-link {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 850px) {
  .document-main {
    padding: 0 28px;
  }
  .editor-layout {
    gap: 24px;
  }
  .paper-preview {
    padding: 24px;
  }
  .document-footer {
    margin: 0 28px;
  }
}
@media (max-width: 650px) {
  .document-main {
    padding: 0 20px;
    margin-top: 25px;
  }
  .tool-title {
    margin-bottom: 30px;
  }
  .tool-title h1 {
    font-size: 35px;
    letter-spacing: -1px;
  }
  .tool-title > p:not(.eyebrow) {
    font-size: 13px;
  }
  .editor-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }
  .editor-panel,
  .preview-panel {
    width: 100%;
  }
  .preview-panel {
    position: static;
  }
  .field-grid {
    gap: 12px;
  }
  .field-grid label {
    font-size: 11px;
  }
  input:not([type='checkbox']):not([type='range']),
  select,
  textarea {
    font-size: 16px;
  }
  .paper-preview {
    padding: 25px;
  }
  .document-footer {
    margin: 0 20px;
  }
  .tool-title .eyebrow {
    font-size: 9px;
  }
  .summary-total {
    font-size: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .budget-meter > span {
    transition: none;
  }
}
@media (max-width: 420px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
}
.method-note {
  background: var(--soft);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 24px;
  font-size: 12px;
}
.method-note p {
  margin: 8px 0 0;
  color: var(--muted);
}
.photo-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.photo-controls .field-hint {
  margin: 0;
}
.paper-photo {
  margin: 14px 0 22px;
}
.paper-photo img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: var(--soft);
  border-radius: 8px;
}
.paper-photo figcaption {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
.editor-panel > .btn {
  max-width: 100%;
}
.item-row input[type='file'] {
  font-size: 12px;
  padding: 10px;
}
