/* SpareThought components — static reference styles for the previews (1 CSS px = 1 dp).
   Phone is the default; add .st-tab on a container for the tablet type scale and density. */

.st {
  font-family: var(--font-sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.st *,
.st *::before,
.st *::after {
  box-sizing: border-box;
}
.st p,
.st h2,
.st h3 {
  margin: 0;
}
.st-ic {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.st-cap {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}
.st-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.st-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.st-demo {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: flex-start;
  padding: var(--space-4);
  background: var(--surface);
}
.st-demo > .st-col {
  gap: var(--space-2);
}

/* Buttons */
.st-btn {
  height: var(--control-height);
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: var(--stroke-hairline) solid var(--outline);
  background: var(--surface);
  color: var(--ink);
  font: 500 14px/20px var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
  cursor: pointer;
}
.st-btn.primary {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--on-forest);
}
.st-btn.danger {
  color: var(--urgent);
  border-color: var(--urgent);
}
.st-btn.danger-filled {
  background: var(--urgent);
  border-color: var(--urgent);
  color: var(--on-forest);
}
.st-btn.text {
  border-color: transparent;
  color: var(--forest);
  padding: 0 12px;
}
.st-btn:disabled,
.st-btn.disabled {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--muted);
  cursor: default;
}
.st-btn:focus-visible,
.st-ib:focus-visible,
.st-chip:focus-visible,
.st-opt:focus-visible {
  outline: var(--stroke-frame) solid var(--forest);
  outline-offset: 2px;
}
.st-btn .st-ic {
  width: 18px;
  height: 18px;
}

/* Icon button + selected-tool box */
.st-ib {
  width: var(--target-min);
  height: var(--target-min);
  flex: none;
  border: 0;
  background: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border-radius: var(--radius-md);
  position: relative;
  cursor: pointer;
}
.st-ib.on {
  color: var(--forest);
}
.st-ib.on::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: var(--radius-md);
  background: var(--sage-selected);
  border: var(--stroke-frame) solid var(--forest);
}
.st-ib.on .st-ic {
  position: relative;
}
.st-ib.danger {
  color: var(--urgent);
}
.st-ib:disabled {
  color: var(--outline);
}

/* Fields */
.st-label {
  font: 500 14px/20px var(--font-sans);
  color: var(--ink);
}
.st-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  border: var(--stroke-hairline) solid var(--outline);
  border-radius: var(--radius-md);
  padding: 0 4px 0 12px;
  font: 400 16px/24px var(--font-sans);
  background: var(--surface);
  color: var(--ink);
}
.st-field.focus {
  border: var(--stroke-frame) solid var(--forest);
  padding-left: 11px;
}
.st-field.error {
  border: var(--stroke-frame) solid var(--urgent);
  padding-left: 11px;
}
.st-field .ph {
  color: var(--muted);
}
.st-field .val {
  flex: 1;
  min-width: 0;
}
.st-caret {
  display: inline-block;
  width: 2px;
  height: 22px;
  background: var(--forest);
  vertical-align: middle;
}
.st-help {
  font: 400 12px/16px var(--font-sans);
  color: var(--muted);
}
.st-help.err {
  color: var(--urgent);
  font-weight: 700;
}
.st-count {
  font: 400 12px/16px var(--font-sans);
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Chips and segments */
.st-chip {
  height: var(--chip-height);
  margin: 4px 0;
  padding: 0 14px;
  border: var(--stroke-hairline) solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: 400 14px/1 var(--font-sans);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.st-chip.on {
  background: var(--sage-selected);
  border: var(--stroke-frame) solid var(--forest);
  font-weight: 700;
  padding-left: 8px;
}
.st-chip .st-ic {
  width: 18px;
  height: 18px;
}
.st-seg {
  display: grid;
  border: var(--stroke-hairline) solid var(--outline);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: var(--control-height);
}
.st-seg button {
  border: 0;
  border-left: var(--stroke-hairline) solid var(--outline);
  background: var(--surface);
  color: var(--ink);
  font: 400 14px/1 var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
.st-seg button:first-child {
  border-left: 0;
}
.st-seg button.on {
  background: var(--sage-selected);
  font-weight: 700;
}
.st-seg .st-ic {
  width: 18px;
  height: 18px;
}

/* Option rows */
.st-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--control-height);
  padding: 0 12px;
  border: var(--stroke-hairline) solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: 400 16px/24px var(--font-sans);
  color: var(--ink);
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.st-opt.on {
  background: var(--sage-selected);
  border: var(--stroke-frame) solid var(--forest);
  font-weight: 700;
  padding: 0 11px;
}
.st-opt .t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.st-opt .sub {
  font: 400 12px/16px var(--font-sans);
  color: var(--muted);
}
.st-opt.on .sub {
  color: var(--ink);
}

/* Toggle, check box */
.st-toggle {
  width: 52px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--forest);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 3px;
  flex: none;
  border: 0;
}
.st-toggle i {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
}
.st-toggle i .st-ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}
.st-toggle.off {
  background: var(--surface);
  border: var(--stroke-hairline) solid var(--outline);
  justify-content: flex-start;
}
.st-toggle.off i {
  border: var(--stroke-hairline) solid var(--outline);
}
.st-check {
  width: 20px;
  height: 20px;
  border: var(--stroke-frame) solid var(--ink);
  border-radius: var(--radius-sm);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.st-check.on {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--on-forest);
}
.st-check .st-ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

/* Rows, sections, cards */
.st-srow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 4px 0;
}
.st-srow .t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.st-srow .l {
  font: 400 16px/24px var(--font-sans);
}
.st-srow .s {
  font: 400 12px/16px var(--font-sans);
  color: var(--muted);
}
.st-srow .v {
  display: flex;
  align-items: center;
  gap: 4px;
  font: 400 14px/20px var(--font-sans);
  color: var(--muted);
  flex: none;
}
.st-sec {
  border-top: var(--stroke-hairline) solid var(--divider);
  padding-top: var(--space-2);
}
.st-sec:first-child {
  border-top: 0;
  padding-top: 0;
}
.st-sec h3 {
  font: 700 16px/24px var(--font-sans);
  height: 40px;
  display: flex;
  align-items: center;
}
.st-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 8px 4px 8px 16px;
  border: var(--stroke-hairline) solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.st-card.on {
  background: var(--sage-selected);
  border: var(--stroke-frame) solid var(--forest);
  padding-left: 15px;
}
.st-card .t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-card .ti {
  font: 500 16px/24px var(--font-sans);
}
.st-card .me {
  font: 400 12px/16px var(--font-sans);
  color: var(--muted);
}
.st-card.on .me {
  color: var(--ink);
}

/* Dialog frame, sheet, menu */
.st-dlg {
  background: var(--surface);
  border: var(--stroke-frame) solid var(--ink);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.st-hd {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 16px 4px 12px 16px;
}
.st-hd .tt {
  flex: 1;
  min-width: 0;
}
.st-hd h2 {
  font: 400 22px/28px var(--font-sans);
}
.st-hd .sub {
  font: 400 12px/16px var(--font-sans);
  color: var(--muted);
  margin-top: 2px;
}
.st-hd.dv {
  border-bottom: var(--stroke-hairline) solid var(--divider);
}
.st-bd {
  position: relative;
  padding: var(--space-2) 24px var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.st-ft {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  padding: 12px var(--space-4) var(--space-4);
}
.st-ft.dv {
  border-top: var(--stroke-hairline) solid var(--divider);
}
.st-ft .lead {
  margin-right: auto;
}
.st-sheet {
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.st-handle {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-handle i {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--outline);
}
.st-scrim {
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.st-menu {
  background: var(--surface);
  border: var(--stroke-frame) solid var(--ink);
  border-radius: var(--radius-md);
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}
.st-menu .hd {
  font: 500 12px/16px var(--font-sans);
  color: var(--muted);
  padding: 8px 16px 4px;
}
.st-mi {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--target-min);
  padding: 0 16px;
  font: 400 16px/24px var(--font-sans);
  color: var(--ink);
  border: 0;
  background: none;
  text-align: left;
  width: 100%;
}
.st-mi.danger {
  color: var(--urgent);
}
.st-mdv {
  height: 1px;
  background: var(--divider);
  margin: 4px 0;
}

/* Scrollbar */
.st-scroll {
  position: relative;
}
.st-scroll .trk {
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 7px;
  width: 1px;
  background: var(--divider);
}
.st-scroll .thm {
  position: absolute;
  right: 5px;
  width: 6px;
  border-radius: var(--radius-full);
  background: var(--outline);
}

/* Tool strip */
.st-strip {
  display: inline-flex;
  flex-direction: column;
  background: var(--surface);
  border: var(--stroke-frame) solid var(--ink);
  border-radius: var(--radius-md);
  padding: 0 4px;
}
.st-strip .r {
  display: flex;
  align-items: center;
}
.st-strip .r + .r {
  border-top: var(--stroke-hairline) solid var(--divider);
}
.st-strip .g {
  display: flex;
  align-items: center;
}
.st-strip .sp {
  width: 1px;
  height: 24px;
  background: var(--divider);
  margin: 0 4px;
  flex: none;
}
.st-num {
  font: 500 14px/20px var(--font-sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Calendar grid */
.st-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}
.st-cal .wd {
  font: 500 12px/16px var(--font-sans);
  color: var(--muted);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-cal .d {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font: 400 14px/1 var(--font-sans);
  color: var(--ink);
}
.st-cal .d b {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 400;
}
.st-cal .d.out {
  color: var(--outline);
}
.st-cal .d.today b {
  border: var(--stroke-frame) solid var(--forest);
  color: var(--forest);
  font-weight: 700;
}
.st-cal .d.sel b {
  background: var(--forest);
  color: var(--on-forest);
  font-weight: 700;
}
.st-cal .d i {
  position: absolute;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--ink);
}

/* Swatches */
.st-sw {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
}
.st-sw button {
  height: var(--target-min);
  border-radius: var(--radius-md);
  border: var(--stroke-hairline) solid var(--divider);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-sw button span {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-forest);
}
.st-sw button.on {
  border: var(--stroke-frame) solid var(--forest);
  background: var(--sage-selected);
}
.st-sw .st-ic {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* Dotted paper tile */
.st-paper {
  border: var(--stroke-hairline) solid var(--divider);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  background-image: radial-gradient(var(--divider) 1px, transparent 1.3px);
  background-size: 8px 8px;
  background-position: 4px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* Slider, stepper */
.st-slider {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
}
.st-slider .tr {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--divider);
}
.st-slider .fl {
  position: absolute;
  left: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--forest);
}
.st-slider .kn {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: var(--stroke-frame) solid var(--forest);
  margin-left: -12px;
}

/* Pills */
.st-pill {
  height: 28px;
  padding: 0 12px;
  border: var(--stroke-hairline) solid var(--outline);
  border-radius: var(--radius-full);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12px/16px var(--font-sans);
  white-space: nowrap;
}
.st-pill .rail {
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--calendar-rail);
}
.st-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--sage);
  font: 700 12px/1 var(--font-sans);
  color: var(--ink);
}

/* Tablet scale (TabletTokens: 18 sp body, 24 sp titles, 17–18 sp buttons, 56 dp rows) */
.st-tab .st-btn {
  font-size: 18px;
}
.st-tab .st-label {
  font-size: 18px;
  line-height: 24px;
}
.st-tab .st-field,
.st-tab .st-opt,
.st-tab .st-mi,
.st-tab .st-srow .l {
  font-size: 18px;
  line-height: 26px;
}
.st-tab .st-help,
.st-tab .st-count,
.st-tab .st-srow .s,
.st-tab .st-card .me,
.st-tab .st-opt .sub,
.st-tab .st-hd .sub,
.st-tab .st-cal .wd {
  font-size: 16px;
  line-height: 22px;
}
.st-tab .st-chip,
.st-tab .st-seg button {
  font-size: 17px;
}
.st-tab .st-opt,
.st-tab .st-srow,
.st-tab .st-mi {
  min-height: 56px;
}
.st-tab .st-card .ti {
  font-size: 18px;
  line-height: 26px;
}
.st-tab .st-hd {
  padding: 24px 12px 16px 24px;
}
.st-tab .st-hd h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 500;
}
.st-tab .st-bd {
  padding: 16px 32px 24px 24px;
  gap: var(--space-6);
}
.st-tab .st-ft {
  padding: 16px 24px 24px;
}
.st-tab .st-sec h3 {
  font-size: 18px;
}
.st-tab .st-cal .d {
  font-size: 17px;
}
.st-tab .st-cal .d b {
  width: 40px;
  height: 40px;
}
.st-tab .st-num {
  font-size: 16px;
}
.st-tab .st-pill {
  height: 28px;
  font-size: 14px;
}
