/* ==========================================================================
   Site header / footer
   ========================================================================== */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.site-header__brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--color-text);
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-header__link {
  font-weight: 500;
  color: var(--color-text-muted);
}

.site-header__link:hover,
.site-header__link:focus-visible {
  color: var(--color-primary);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-5);
}

.site-footer__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--space-4);
  text-align: center;
}

.site-footer__inner p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
}

.site-footer__links a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   Homepage / tool grid
   ========================================================================== */

.home {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}

.home__intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-5);
}

.home__intro p {
  margin: 0;
}

.tool-search {
  position: relative;
  max-width: 600px;
  margin: 0 auto var(--space-5);
}

.tool-search__input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 1.0625rem;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-search__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.tool-search__results {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 360px;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.tool-search__result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.1s ease;
}

.tool-search__result:hover,
.tool-search__result.is-active {
  background: var(--color-bg);
}

.tool-search__result-icon {
  flex: 0 0 auto;
  font-size: 1.25rem;
}

.tool-search__result-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tool-search__result-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
}

.tool-search__result-desc {
  overflow: hidden;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home__toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.home__toc-links {
  list-style: none;
  margin: 0;
  padding: 0;
  line-height: 1.8;
}

.home__toc-links li {
  display: inline;
}

.home__toc-links li:not(:last-child)::after {
  content: " «» ";
  color: var(--color-text-muted);
}

.home__toc-links a {
  font-size: 0.9375rem;
  color: var(--color-link);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.25s ease;
}

.home__toc-links a:hover,
.home__toc-links a:focus-visible {
  color: var(--color-maroon);
  background-size: 100% 1px;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 600px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  /* 20 tools / 4 columns = 5 tools per column */
  .tool-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tool-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-sticky-bg);
  border: 1px solid var(--color-sticky-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tool-tile:hover,
.tool-tile:focus-visible {
  transform: translateY(-2px);
  box-shadow: 3px 5px 10px rgba(0, 0, 0, 0.16);
  border-color: var(--color-sticky-text-muted);
}

.tool-tile__icon {
  font-size: 1.75rem;
  line-height: 1;
}

.tool-tile__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-sticky-text);
}

.tool-tile__desc {
  font-size: 0.875rem;
  color: var(--color-sticky-text-muted);
  line-height: 1.4;
}

.tool-category {
  margin-bottom: var(--space-5);
}

.tool-category__title {
  font-size: 1.125rem;
  margin-bottom: var(--space-3);
}

/* ==========================================================================
   Tool page shell
   ========================================================================== */

.tool-page {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Visual order vs. HTML source order (instruction.md 19.1): .tool-seo-content and
   .related-tools are placed early in the HTML source (for SEO/crawling), right
   after the <h1>, but rendered last visually so the calculator itself stays the
   first thing a user sees. Ties fall back to source order, which already puts
   .tool-page__desc right after h1 and .counter-controls right after
   .result-panel, so no extra rule is needed for those pairs. See the
   accessibility note in header.php for the screen-reader/keyboard-nav tradeoff
   this creates. */
.tool-page > h1 { order: 1; }
.tool-page > .tool-page__desc { order: 1; }
.tool-page > .tool-card { order: 2; }
.tool-page > .result-panel { order: 3; }
.tool-page > .breathing-stage { order: 3; }
.tool-page > .counter-controls { order: 3; }
.tool-page > .tool-seo-content { order: 4; }
.tool-page > .related-tools { order: 5; }
/* Notepad's tab bar and Cut/Clear/Undo row sit above its textarea, unlike
   other tools' .counter-controls (which stays below the input). Widths are
   kept in sync with the note textarea by sizing.js (matching .notepad-card
   below); these are just the pre-JS/no-JS fallback, sized to the textarea's
   own default width plus the card's padding/border. */
.tool-page > .notepad-tabs {
  order: 1;
  width: 642px;
  max-width: 100%;
  align-self: center;
}

.tool-page > .notepad-actions {
  order: 1;
  width: 642px;
  max-width: 100%;
  align-self: center;
}

/* Notepad's note area can be resized wider than the site's usual 640px
   column, so its page gets extra room -- but the prose (heading, intro,
   SEO content, related tools) stays at the normal reading width, centered
   within that extra room, so only the card+textarea actually use it. */
.tool-page--wide {
  max-width: 900px;
}

.tool-page--wide > h1,
.tool-page--wide > .tool-page__desc,
.tool-page--wide > .tool-seo-content,
.tool-page--wide > .related-tools {
  width: 100%;
  max-width: 592px;
  margin-left: auto;
  margin-right: auto;
}

/* Width is kept in sync with the note textarea by sizing.js -- a CSS-only
   fit-content sizing was tried here first, but a wide toolbar row inside the
   card (more buttons than fit on one line) pegged it at its max-width
   regardless of the textarea's actual width, so the two came apart. This is
   just the pre-JS/no-JS fallback, matching the textarea's own default width
   plus the card's padding/border. */
.notepad-card {
  width: 642px;
  max-width: 100%;
  align-self: center;
}

/* Notepad toolbar buttons stay compact -- there are several rows of them
   (actions, symbols) and more get added over time, so they shouldn't crowd
   out the note itself. */
.notepad-actions .btn,
.notepad-symbols .btn,
.notepad-format-row .btn {
  padding: var(--space-1) var(--space-3);
  font-size: 0.8125rem;
}

.notepad-format-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}

.notepad-format-row .input-group {
  flex: 0 1 140px;
}

.notepad-format-row .input-group select {
  font-size: 0.875rem;
}

.notepad-stepper {
  flex: 0 0 auto;
}

.notepad-stepper label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.notepad-stepper__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.notepad-stepper .btn-circle.btn-sm {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.notepad-stepper__value {
  min-width: 3.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.notepad-stepper input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
}

.notepad-symbols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.notepad-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.notepad-tab {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.notepad-tab--active {
  border-color: var(--color-primary);
  background: rgba(79, 70, 229, 0.08);
}

.notepad-tab__name {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.notepad-tab--active .notepad-tab__name {
  color: var(--color-primary);
}

.notepad-tab__delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.notepad-tab__delete:hover:not(:disabled) {
  background: var(--color-border);
  color: var(--color-text);
}

.notepad-tab__delete:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.notepad-tab__add {
  padding: var(--space-1) var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.notepad-tab__add:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.notepad-picker.notepad-confirm {
  max-width: 380px;
  padding: var(--space-4);
  gap: var(--space-4);
}

.notepad-confirm__message {
  margin: 0;
  color: var(--color-text);
}

.notepad-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.notepad-symbols__selected {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25em;
  padding: var(--space-1) var(--space-2);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

.notepad-symbols__divider {
  align-self: stretch;
  width: 1px;
  margin: 0 var(--space-1);
  background: var(--color-border);
}

.notepad-stats {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.notepad-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 1000;
}

.notepad-picker-overlay[hidden] {
  display: none;
}

.notepad-picker {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notepad-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.notepad-picker__header h2 {
  font-size: 1.0625rem;
  margin: 0;
}

.notepad-picker__close {
  background: none;
  border: none;
  padding: var(--space-1);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}

.notepad-picker__close:hover {
  color: var(--color-text);
}

.notepad-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: var(--space-2);
  padding: var(--space-4);
  overflow-y: auto;
}

.notepad-picker__item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.notepad-picker__item:hover {
  border-color: var(--color-primary);
  background: var(--color-surface);
}

.tool-page__desc {
  color: var(--color-text-muted);
}

.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ==========================================================================
   SEO content block + related tools
   ========================================================================== */

.tool-seo-content {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.tool-seo-content h2 {
  font-size: 1.25rem;
}

.tool-seo-content h3 {
  font-size: 1rem;
  margin-bottom: var(--space-2);
}

.tool-seo-content p {
  margin-bottom: var(--space-4);
}

.tool-faq {
  margin: 0;
}

.tool-faq dt {
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-3);
}

.tool-faq dd {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
}

.related-tools {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.related-tools h2 {
  font-size: 1.125rem;
}

.related-tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.related-tools__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.related-tools__item:hover,
.related-tools__item:focus-visible {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.related-tools__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.related-tools__viewall {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* ==========================================================================
   Inputs
   ========================================================================== */

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-group label {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.input-group__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.input-group__hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.input-group input[type="file"] {
  padding: var(--space-2) 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.input-group input[type="file"]::file-selector-button {
  padding: var(--space-2) var(--space-3);
  margin-right: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.input-group input[type="file"]::file-selector-button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.input-group input[type="number"],
.input-group input[type="text"],
.input-group input[type="date"],
.input-group input[type="datetime-local"],
.input-group input[type="time"],
.input-group select,
.input-group textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-group input[type="number"] {
  max-width: 140px;
}

/* A textarea's native resize handle sets an inline pixel width that would
   otherwise override the width:100% above, letting it get dragged wider than
   its container and poke out past the card. max-width clamps that while
   still allowing the drag to shrink it back down. */
.input-group textarea {
  min-width: 200px;
  max-width: 100%;
  min-height: 100px;
}

/* The note textarea gets real horizontal slack to resize into: an explicit
   default width (not 100%, which would already equal its own max-width and
   leave no room to grow) and a generous max-width. sizing.js reads the
   textarea's actual rendered width and applies it to its .notepad-card
   ancestor, so the card grows and shrinks along with it as it's dragged --
   which is also why these bounds are deliberately viewport-relative (vw)
   rather than a percentage of the card: the card's own width comes FROM the
   textarea's width, so a percentage here would be circular and effectively
   freeze both at whatever size they started at. */
#notepadText {
  width: min(592px, calc(100vw - 98px));
  max-width: min(760px, calc(100vw - 98px));
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.input-group input:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.checkbox-row label {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--color-text);
}

/* Range slider */
.input-group input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--color-border);
  outline: none;
}

.input-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.input-group input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--color-primary-hover);
  transform: scale(1.1);
}

.input-group input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--color-border);
}

.input-group input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.input-group input[type="range"]::-moz-range-thumb:hover {
  background: var(--color-primary-hover);
  transform: scale(1.1);
}

/* ==========================================================================
   Image preview (canvas-based image tools)
   ========================================================================== */

.image-preview {
  display: flex;
  justify-content: center;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.image-preview__canvas {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background-image:
    linear-gradient(45deg, var(--color-border) 25%, transparent 25%),
    linear-gradient(-45deg, var(--color-border) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--color-border) 75%),
    linear-gradient(-45deg, transparent 75%, var(--color-border) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* ==========================================================================
   Wheel picker (iOS-style scrollable date/time columns)
   ========================================================================== */

.wheel-picker {
  position: relative;
  display: flex;
  height: 180px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.wheel-picker::before,
.wheel-picker::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 72px;
  pointer-events: none;
  z-index: 2;
}

.wheel-picker::before {
  top: 0;
  background: linear-gradient(to bottom, var(--color-bg), rgba(250,250,250,0));
}

.wheel-picker::after {
  bottom: 0;
  background: linear-gradient(to top, var(--color-bg), rgba(250,250,250,0));
}

.wheel-picker__highlight {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 36px;
  transform: translateY(-50%);
  background: rgba(79, 70, 229, 0.08);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  pointer-events: none;
  z-index: 1;
}

.wheel-picker__col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  outline: none;
}

.wheel-picker__col--ampm {
  flex: 0 0 58px;
}

.wheel-picker__col::-webkit-scrollbar {
  display: none;
}

.wheel-picker__col:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.wheel-picker__list {
  list-style: none;
  margin: 0;
  padding: 72px 0;
}

.wheel-picker__item {
  height: 36px;
  line-height: 36px;
  text-align: center;
  scroll-snap-align: center;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, font-weight 0.15s ease;
}

.wheel-picker__item.is-selected {
  color: var(--color-text);
  font-weight: 600;
}

@media (max-width: 480px) {
  .wheel-picker {
    height: 160px;
  }
  .wheel-picker::before,
  .wheel-picker::after {
    height: 62px;
  }
  .wheel-picker__list {
    padding: 62px 0;
  }
  .wheel-picker__item {
    font-size: 0.9375rem;
  }
}

/* ==========================================================================
   Result panel
   ========================================================================== */

.result-panel {
  text-align: center;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.result-value {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.result-label {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.result-value.is-negative {
  color: var(--color-error);
}

.result-value.is-success {
  color: var(--color-success);
}

.result-value--mono {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.5rem;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.result-stats:empty {
  display: none;
  margin-top: 0;
}

.result-stat {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.result-stat:only-child {
  grid-column: 1 / -1;
}

.result-stat__label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.result-stat__value {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .result-stats {
    grid-template-columns: 1fr;
  }
}

@keyframes result-flash {
  0% { transform: scale(1.08); color: var(--color-success); }
  100% { transform: scale(1); color: var(--color-primary); }
}

/* ==========================================================================
   Text editor toolbar (glyph/emoji/symbol pickers, format buttons)
   ========================================================================== */

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.btn-bold {
  font-weight: 700;
}

.btn-italic {
  font-style: italic;
}

.btn-code {
  font-family: 'Courier New', Courier, monospace;
}

.btn-strike {
  text-decoration: line-through;
}

.glyph-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-height: 220px;
  overflow-y: auto;
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.glyph-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-border);
  color: var(--color-maroon);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.glyph-btn:hover,
.glyph-btn:focus-visible {
  border-color: var(--color-primary);
  outline: none;
}

.glyph-btn:active {
  transform: scale(0.92);
}

.result-flash {
  animation: result-flash 0.3s ease;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-lg {
  padding: var(--space-3) var(--space-5);
  font-size: 1.125rem;
}

.btn-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 0;
  font-size: 2rem;
  line-height: 1;
}

.btn-circle.btn-lg {
  width: 112px;
  height: 112px;
  font-size: 2.5rem;
}

.btn-circle.btn-sm {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Counter controls (tap counter, and any other +/- stepper tool)
   ========================================================================== */

.counter-display .result-value {
  font-size: 4rem;
}

.result-value-sub {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  vertical-align: baseline;
  font-variant-numeric: tabular-nums;
}

.counter-display.is-complete .result-value {
  color: var(--color-success);
}

.counter-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

@media (max-width: 400px) {
  .btn-circle.btn-lg {
    width: 96px;
    height: 96px;
    font-size: 2rem;
  }
}

/* ==========================================================================
   Currency converter (swap control, footnote)
   ========================================================================== */

.currency-swap-row {
  display: flex;
  justify-content: center;
}

.tool-page__note {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: var(--space-2) 0 0;
}

.tool-page__note--error {
  color: var(--color-error);
  font-weight: 600;
}

.life-grid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.life-grid-scroll {
  width: 100%;
  max-height: 70vh;
  overflow: auto;
  display: flex;
  justify-content: center;
}

.life-grid-scroll canvas {
  display: block;
}

.hash-output {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.code-output {
  width: 100%;
  min-height: 240px;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  resize: vertical;
}

/* ==========================================================================
   Diff output (Text Diff Checker)
   ========================================================================== */

.diff-output {
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.diff-added {
  background: rgba(22, 163, 74, 0.15);
  color: var(--color-success);
  border-radius: 3px;
}

.diff-removed {
  background: rgba(220, 38, 38, 0.15);
  color: var(--color-error);
  text-decoration: line-through;
  border-radius: 3px;
}

.regex-match {
  background: rgba(79, 70, 229, 0.25);
  color: var(--color-text);
  border-radius: 3px;
  padding: 0 1px;
}

.regex-match--alt {
  background: rgba(217, 119, 6, 0.25);
}

.moon-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  background: radial-gradient(ellipse at center, #1b2035 0%, #0a0c18 100%);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.moon-disc {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background: #22263b;
  box-shadow: 0 0 30px rgba(240, 230, 200, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.moon-lit {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  background: #f2ecd5;
}

.moon-ellipse {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  border-radius: 50%;
  transform: translateX(-50%);
}

.typing-correct {
  color: var(--color-success);
}

.typing-incorrect {
  color: var(--color-error);
  background: rgba(220, 38, 38, 0.15);
  border-radius: 2px;
}

.typing-pending {
  color: var(--color-text-muted);
}

.typing-current {
  color: var(--color-text-muted);
  border-left: 2px solid var(--color-primary);
  animation: typing-caret-blink 1s step-end infinite;
}

@keyframes typing-caret-blink {
  50% { border-left-color: transparent; }
}

/* ==========================================================================
   Segmented control (mode switcher) + mode panels
   ========================================================================== */

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.segmented-control__btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented-control__btn:hover {
  color: var(--color-text);
}

.segmented-control__btn.is-active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.mode-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .input-grid {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }
}

/* ==========================================================================
   Dice Roller
   ========================================================================== */

.dice-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-3);
  perspective: 600px;
}

.die-3d {
  width: 64px;
  height: 64px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.die-3d__face {
  position: absolute;
  width: 64px;
  height: 64px;
  box-sizing: border-box;
  padding: 10px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.die-3d__face--front  { transform: translateZ(32px); }
.die-3d__face--back   { transform: rotateY(180deg) translateZ(32px); }
.die-3d__face--top    { transform: rotateX(90deg) translateZ(32px); }
.die-3d__face--bottom { transform: rotateX(-90deg) translateZ(32px); }
.die-3d__face--right  { transform: rotateY(90deg) translateZ(32px); }
.die-3d__face--left   { transform: rotateY(-90deg) translateZ(32px); }

.die-3d__pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  justify-self: center;
  align-self: center;
}

.die-flat {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--color-primary);
}

.die-flat.is-rolling {
  animation: die-flat-spin 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes die-flat-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(540deg) scale(1.15); }
  100% { transform: rotate(720deg) scale(1); }
}

/* ==========================================================================
   Timesheet rows (Timesheet / Hours Worked Calculator)
   ========================================================================== */

.timesheet-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.timesheet-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.timesheet-row input[type="time"] {
  flex: 1;
  min-width: 0;
}

.timesheet-row__value {
  flex-shrink: 0;
  min-width: 5.5em;
  text-align: right;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.timesheet-row input[type="text"],
.timesheet-row input[type="number"],
.timesheet-row select {
  flex: 1;
  min-width: 0;
}

.timesheet-row__arrow {
  flex: 0 0 auto;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Split Bill / Group Expense Calculator
   ========================================================================== */

.expense-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.expense-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.expense-row__main {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.expense-row__main .expense-row__desc {
  flex: 2;
  min-width: 120px;
}

.expense-row__main input[type="number"],
.expense-row__main select {
  flex: 1;
  min-width: 100px;
}

.expense-row__split-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.settle-up-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.settle-up-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-weight: 500;
}

.settle-up-item__amount {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
}

/* ==========================================================================
   Password Strength Checklist
   ========================================================================== */

.strength-checklist {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: left;
}

.strength-checklist__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.strength-checklist__item--pass {
  color: var(--color-success);
}

.strength-checklist__item--fail {
  color: var(--color-error);
}

/* ==========================================================================
   Color swatch (Color Converter)
   ========================================================================== */

.color-swatch {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
  font-size: 1.25rem;
  font-weight: 600;
  transition: color 0.15s ease, background-color 0.15s ease;
}

/* ==========================================================================
   Meeting planner grid (Multi-Timezone Meeting Planner)
   ========================================================================== */

.mp-table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.mp-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.mp-table th,
.mp-table td {
  padding: var(--space-2);
  text-align: center;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.mp-table th {
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-weight: 600;
}

.mp-table__label {
  text-align: left;
  font-weight: 600;
  position: sticky;
  left: 0;
  background: var(--color-surface);
}

.mp-cell--working {
  background: rgba(22, 163, 74, 0.12);
  color: var(--color-success);
  font-weight: 600;
}

.mp-cell--off {
  color: var(--color-text-muted);
}

.mp-cell--overlap {
  background: var(--color-success);
  color: #fff;
  font-weight: 700;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8125rem;
}

.data-table th,
.data-table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table th {
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.data-table-wrap {
  max-height: 70vh;
  overflow-y: auto;
}

/* ==========================================================================
   Depth of Field Diagram
   ========================================================================== */

.dof-diagram-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.dof-diagram {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 170px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-4) var(--space-5);
  overflow: hidden;
}

.dof-diagram__zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(79, 70, 229, 0.10);
  border-left: 2px dashed var(--color-primary);
  border-right: 2px dashed var(--color-primary);
  transition: left 0.2s ease, width 0.2s ease;
}

.dof-diagram__pattern {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-3);
}

.dof-diagram__tick {
  width: 3px;
  height: 100%;
  min-width: 3px;
  border-radius: 2px;
  background: var(--color-text-muted);
  opacity: 0.45;
  transition: filter 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.dof-diagram__tick.is-sharp {
  background: var(--color-primary);
  opacity: 1;
}

.dof-diagram__marker {
  position: absolute;
  top: 28px;
  bottom: 26px;
  width: 0;
  border-left: 2px dashed var(--color-text-muted);
  transform: translateX(-50%);
  transition: left 0.2s ease;
}

.dof-diagram__marker--subject {
  border-left-style: solid;
  border-left-color: var(--color-primary);
  border-left-width: 2px;
}

.dof-diagram__marker-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  font-weight: 600;
  bottom: -22px;
}

.dof-diagram__marker--subject .dof-diagram__marker-label {
  top: -22px;
  bottom: auto;
  color: var(--color-primary);
}

.dof-diagram__camera {
  flex-shrink: 0;
  font-size: 1.6rem;
  line-height: 1;
}

.dof-diagram__infinity {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
}

.dof-diagram__legend {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.dof-diagram__legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: var(--space-1);
  vertical-align: middle;
}

/* ==========================================================================
   Chord Diagrams
   ========================================================================== */

.chord-diagram-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.chord-diagram {
  width: 100px;
  text-align: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

.chord-diagram__name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: var(--space-1);
}

.chord-diagram__unavailable {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: var(--space-3) 0;
}

.chord-diagram__body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

.chord-diagram__fret-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 14px;
  white-space: nowrap;
}

.chord-diagram__grid-wrap {
  position: relative;
  width: 70px;
}

.chord-diagram__markers {
  position: relative;
  height: 14px;
}

.chord-diagram__marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  line-height: 1;
}

.chord-diagram__grid {
  position: relative;
  width: 70px;
  height: 60px;
}

.chord-diagram__grid.has-nut {
  border-top: 3px solid var(--color-text);
}

.chord-diagram__grid.no-nut {
  border-top: 1px solid var(--color-border);
}

.chord-diagram__string {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}

.chord-diagram__fretline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}

.chord-diagram__dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  transform: translate(-50%, -50%);
}

.chord-diagram__bassnote {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ==========================================================================
   Tap Tempo Button
   ========================================================================== */

.tap-pulse-btn.is-tapped {
  animation: tap-pulse 0.25s ease-out;
}

@keyframes tap-pulse {
  0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.5); }
  100% { transform: scale(1); box-shadow: 0 0 0 18px rgba(79, 70, 229, 0); }
}

/* ==========================================================================
   Breathing Exercise Timer
   ========================================================================== */

.breathing-stage {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.breathing-ring-outer,
.breathing-ring-mid,
.breathing-orb {
  position: absolute;
  border-radius: 50%;
}

.breathing-ring-outer {
  width: 92%;
  height: 92%;
  border: 1px solid var(--color-border);
}

.breathing-ring-mid {
  width: 74%;
  height: 74%;
  border: 1px dashed var(--color-border);
  animation: breathing-slow-spin 60s linear infinite;
}

@keyframes breathing-slow-spin {
  to { transform: rotate(360deg); }
}

.breathing-orb {
  width: 34%;
  height: 34%;
  background: rgba(79, 70, 229, 0.12);
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 24px rgba(79, 70, 229, 0.25);
  transition: transform var(--breath-duration, 4s) cubic-bezier(0.4, 0, 0.6, 1);
  transform: scale(1);
}

.breathing-orb.is-inhaling,
.breathing-orb.is-holding {
  transform: scale(2);
}

.breathing-orb.is-exhaling {
  transform: scale(1);
}

.breathing-phase-label {
  position: relative;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.breathing-phase-name {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.breathing-count {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--color-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.breathing-phase-name.is-complete {
  color: var(--color-success);
}

.breathing-round {
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  min-height: 1.2em;
}

.breathing-fullscreen-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 3;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.breathing-fullscreen-btn:hover,
.breathing-fullscreen-btn:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Full-screen mode: the ring/orb/text sizes switch from percentages of the
   (fixed max-width) stage box to vmin units, so they scale directly with the
   actual screen size instead of staying capped at the card's normal size --
   this is what makes the circle genuinely grow on a larger screen rather than
   just filling more empty space around a same-size circle. */
.breathing-stage.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.breathing-stage.is-fullscreen .breathing-ring-outer {
  width: 70vmin;
  height: 70vmin;
}

.breathing-stage.is-fullscreen .breathing-ring-mid {
  width: 56vmin;
  height: 56vmin;
}

.breathing-stage.is-fullscreen .breathing-orb {
  width: 26vmin;
  height: 26vmin;
}

.breathing-stage.is-fullscreen .breathing-phase-name {
  font-size: 2.2vmin;
}

.breathing-stage.is-fullscreen .breathing-count {
  font-size: 9vmin;
}

.breathing-stage.is-fullscreen .breathing-round {
  margin-top: var(--space-3);
  font-size: 2vmin;
}

.breathing-stage.is-fullscreen .breathing-fullscreen-btn {
  width: 44px;
  height: 44px;
  font-size: 1.375rem;
}

@media (max-width: 400px) {
  .breathing-count { font-size: 2rem; }
}
