/* Shared tokens and input rules. Existing date geometry is preserved. */
:root {
  --control-border: #c6ced8;
  --control-text: #26313e;
  --control-radius: 8px;
  --control-background: #fff;
  --accent: var(--blue, #4285f4);
}
:where(.pt-field, .ft-field) :is(input, select) {
  border-color: var(--control-border);
  color: var(--control-text);
  background-color: var(--control-background);
  border-radius: var(--control-radius);
}
:where(.pt-field, .ft-field) :is(input, select):focus {
  outline: none;
  box-shadow: none;
  border-color: var(--control-border);
}
:where(.pt-check, .ft-check) input {
  accent-color: #616b76;
}
.search-hit {
  color: var(--blue, #4285f4);
  background: transparent;
  font-weight: 650;
}
/* One lightweight workbench: project cards + persistent total/actions. */
.tax-workspace,
.pt-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}
.tax-workspace > div,
.pt-workspace > div {
  min-width: 0;
}
.tax-project-list {
  display: grid;
  gap: 16px;
}
.tax-summary,
.pt-summary {
  position: sticky;
  top: 96px;
  align-self: start;
}
.ft-tool {
  max-width: none;
}
.ft-card {
  margin: 0;
  padding: 22px;
}
.tax-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.tax-card-heading > div {
  display: flex;
  gap: 4px;
}
.tax-card-heading button {
  border: 0;
  background: transparent;
  padding: 4px 8px;
  color: var(--muted);
}
.tax-project-name {
  max-width: 520px;
  margin-bottom: 20px;
}
.tax-project-name .ft-field {
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
.tax-project-name .ft-field > span {
  white-space: nowrap;
  flex: 0 0 auto;
}
.ft-grid,
.pt-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.ft-field,
.pt-field,
.tax-choice {
  font-size: 13px;
  gap: 7px;
}
.ft-field input,
.ft-field select,
.tax-choice select {
  height: 42px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 24px;
}
.tax-choice {
  display: flex;
  flex-direction: column;
  color: #647184;
  min-width: 0;
}
.tax-choice select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #fff;
  color: var(--control-text);
  font: inherit;
}
.ft-tool details {
  padding: 10px 0;
  margin: 12px 0;
  border-top: 1px solid #e5e8ec;
}
.ft-tool summary {
  font-size: 13px;
  font-weight: 500;
}
.ft-tool fieldset {
  padding: 14px;
  margin: 12px 0;
}
.tax-card-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  background: #eef1f5;
  border-radius: 8px;
}
.tax-project-total {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: #65758a;
}
.tax-project-total strong {
  color: #425773;
  font-size: 15px;
  font-weight: 600;
}
.tax-card-result button {
  border: 0;
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
  padding: 4px;
}
.tax-input-hint {
  font-size: 12px;
  color: #77818e;
  margin: 8px 0 0;
  min-height: 0;
}
.tax-input-hint:empty {
  display: none;
}
.tax-summary h2 {
  color: var(--blue-dark);
  font-size: 30px;
  font-weight: 600;
  margin: 12px 0 24px;
}
.tax-summary .summary-grid {
  display: block;
}
.tax-summary .summary-grid > div {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.tax-summary .summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.tax-summary .summary-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 15px;
  font-weight: 500;
}
.tax-add {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.tax-detail-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: 85vh;
  border: 1px solid #d7dce3;
  border-radius: 12px;
  padding: 22px;
  color: var(--text);
}
.tax-detail-dialog::backdrop {
  background: #0005;
}
.tax-detail-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.tax-detail-dialog h2 {
  font-size: 18px;
}
.tax-detail-dialog li,
.tax-detail-dialog p {
  line-height: 1.9;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.tax-detail-dialog button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
}
.pt-settings h2,
.pt-segment h3 {
  font-size: 15px;
}
.pt-settings,
.pt-allocation {
  padding: 18px;
}
.pt-note,
.ft-note {
  font-size: 12px;
}
.pt-field small {
  display: none;
}
.pt-property-head .pt-field > span {
  font-size: 13px;
}
.pt-segment {
  padding: 16px;
}
.pt-property-result .pt-result-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.pt-property-result .pt-result-grid strong {
  font-size: 15px;
}
.pt-workspace .project-card {
  padding: 22px;
}
.pt-summary .notice,
.tax-summary .notice {
  font-size: 12px;
  line-height: 1.9;
}
.pt-summary .summary-actions,
.tax-summary .summary-actions {
  margin-top: 20px;
}
.pt-summary #ptTotals,
.pt-summary #ltSummary {
  font-size: 13px;
}
@media (max-width: 1100px) {
  .tax-workspace,
  .pt-workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .ft-grid,
  .pt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .tax-workspace,
  .pt-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .tax-tool,
  .view:has(.pt-workspace) {
    padding-bottom: 100px;
  }
  .tax-summary,
  .pt-summary {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 35;
    border-radius: 0;
    border: 0;
    border-top: 1px solid #d7dce3;
    background: #fff;
    padding: 12px 18px max(12px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 16px;
    box-shadow: 0 -3px 12px #00000005;
  }
  .tax-summary > .eyebrow,
  .pt-summary > .eyebrow {
    font-size: 11px;
    margin: 0;
    grid-column: 1;
  }
  .tax-summary h2,
  .pt-summary h2 {
    font-size: 22px;
    margin: 0;
    grid-column: 1;
  }
  .tax-summary > .summary-grid,
  .tax-summary > .notice,
  .pt-summary > .notice,
  .pt-summary > #ptTotals,
  .pt-summary > #ltSummary,
  .pt-summary > details {
    display: none;
  }
  .tax-summary .summary-actions,
  .pt-summary .summary-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
  }
  .tax-summary .summary-actions button,
  .pt-summary .summary-actions button {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
  }
  .pt-summary .summary-actions button[data-action="copy"],
  .pt-summary .summary-actions button[data-laction="details"] {
    display: none;
  }
  .ft-card,
  .pt-workspace .project-card {
    padding: 16px;
  }
  .ft-grid,
  .pt-grid {
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ft-field input,
  .ft-field select,
  .tax-choice select {
    font-size: 16px;
  }
  .tax-project-name .ft-field {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .tax-card-result {
    padding: 12px;
  }
  .pt-period {
    min-width: 0;
  }
  .pt-property-result .pt-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pt-settings {
    padding: 14px;
  }
  .tax-detail-dialog {
    padding: 16px;
  }
  .ft-period {
    gap: 12px;
  }
}
.ft-grid>.ft-field>span,.ft-grid>.tax-choice>span,.pt-grid>.pt-field>span,.pt-grid>.tax-choice>span{flex:1;display:flex;align-items:flex-end}.tax-detail-dialog pre{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;font:inherit}
