/* Calculator pages: cream form, result card, room rows. */

.tool-crumb {
  margin: 0 0 22px;
  font-size: 14px;
}

.tool-crumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.tool-crumb a:hover {
  color: var(--cream);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 48px;
}

.tool-panel,
.tool-result-panel {
  padding: 28px;
  border-radius: var(--radius-lg);
}

.tool-panel {
  background: var(--cream);
  color: var(--text-ink);
}

.tool-panel h2,
.tool-result-panel h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 26px;
  color: inherit;
}

.tool-panel .tool-lead {
  margin: 0 0 20px;
  color: var(--text-ink-muted);
  font-size: 15px;
}

.tool-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tool-fields .field-wide {
  grid-column: 1 / -1;
}

.tool-panel .btn {
  width: 100%;
  margin-top: 18px;
}

.tool-panel .btn-ghost {
  color: var(--text-ink);
  border-color: #c4bbb3;
}

.tool-panel .btn-ghost:hover {
  color: var(--text-ink);
  border-color: var(--accent);
  background: rgba(220, 89, 48, 0.08);
}

.tool-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  color: var(--text-ink);
  font-size: 15px;
}

.tool-check input {
  margin-top: 4px;
}

.tool-hint {
  margin: 6px 0 0;
  color: var(--text-ink-muted);
  font-size: 13px;
}

.tool-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #c8451c;
  border-radius: var(--radius);
  background: #fff1ec;
  color: #8a2b12;
  font-size: 14px;
}

.tool-rooms {
  display: grid;
  gap: 12px;
}

.tool-room {
  margin: 0;
  padding: 16px;
  border: 1px solid #d7cfc7;
  border-radius: var(--radius);
  background: #fff;
}

.tool-room legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-ink);
}

.tool-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.tool-room-actions .btn {
  width: auto;
  min-height: 42px;
  margin-top: 0;
  padding: 8px 14px;
}

.tool-result-panel {
  border: 1px solid var(--ink-line);
  background: var(--ink-card);
  position: sticky;
  top: 96px;
}

.tool-result-panel [data-tool-result-body] {
  min-height: 1.5em;
}

.tool-result-panel[hidden],
.tool-error[hidden] {
  display: none;
}

.tool-figure {
  margin: 18px 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  color: var(--cream);
}

.tool-figure-note,
.tool-result-panel p,
.tool-result-panel li {
  color: var(--text-muted);
  font-size: 15px;
}

.tool-result-panel ul {
  margin: 12px 0 0;
  padding-left: 1.15rem;
}

.tool-result-panel li + li {
  margin-top: 6px;
}

.tool-result-panel .tool-next {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--ink-line);
}

.tool-next .field + .field {
  margin-top: 12px;
}

.tool-next .field span {
  color: var(--text-muted);
}

.tool-next .field input,
.tool-next .field select {
  background: var(--ink-raised);
  border-color: var(--ink-line);
  color: var(--text);
}

.tool-next .field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.tool-next .btn {
  width: 100%;
  margin-top: 14px;
}

.tool-assumptions {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .tool-result-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .tool-fields {
    grid-template-columns: 1fr;
  }
}
