@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Uncial+Antiqua&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  background: var(--phrond-bg);
  color: var(--phrond-text-primary);
  font-family: var(--phrond-font-body);
  font-size: 106.25%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background: var(--phrond-bg);
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1280px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 0 0 3rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  margin-bottom: 2.5rem;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--phrond-tile-border);
  background: linear-gradient(180deg, #07190e 0%, #030a05 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.brand-product-lockup {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

h1,
h2 {
  font-family: var(--phrond-font-title);
  color: var(--phrond-sundial-gold);
}

.brand-title {
  font-family: var(--phrond-font-brand);
  font-size: 2.75rem;
  letter-spacing: 0.05em;
  color: var(--phrond-sundial-gold);
  text-shadow: -1px -1px 0 #000, 1px 1px 2px rgba(0, 0, 0, 0.85);
}

.brand-product-separator {
  color: var(--phrond-tile-border);
  font-family: var(--phrond-font-body);
  font-size: 1.65rem;
  font-weight: 300;
}

.brand-product-name {
  color: var(--flourish-highlight);
  font-family: var(--phrond-font-title);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
}

.page-title {
  font-family: var(--phrond-font-title);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  color: var(--phrond-sundial-gold);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.site-nav > a,
.site-nav .site-nav-btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.4rem 0.65rem;
  color: var(--phrond-text-primary);
  font-size: 1.05rem;
  font-weight: 400;
  transition: color 150ms ease, opacity 150ms ease;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 1;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  color: var(--phrond-sundial-gold);
  opacity: 1;
}

.site-nav-btn:hover,
.site-nav-btn:focus-visible {
  color: var(--phrond-sundial-gold);
  opacity: 1;
}

@media (min-width: 769px) and (max-width: 820px) {
  .site-header {
    padding-inline: 1rem;
  }

  .brand-product-lockup {
    gap: 0.55rem;
  }

  .brand-title {
    font-size: 2.25rem;
  }

  .brand-product-separator {
    font-size: 1.35rem;
  }

  .brand-product-name {
    font-size: 1.05rem;
  }

  .site-nav {
    gap: 0.55rem;
  }

  .site-nav > a,
  .site-nav .site-nav-btn {
    min-height: 2rem;
    padding: 0.3rem 0.4rem;
    font-size: 0.92rem;
  }
}

.nav-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.35rem;
  position: relative;
  top: 0.12em;
  vertical-align: middle;
  border-left: 0.32rem solid transparent;
  border-right: 0.32rem solid transparent;
  border-top: 0.42rem solid currentColor;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 300;
  display: none;
  min-width: 240px;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--phrond-tile-border);
  border-radius: 6px;
  background: var(--phrond-surface-panel);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.95);
}

.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -15px;
  right: 0;
  left: 0;
  height: 15px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.site-nav .dropdown-item {
  display: block;
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  font-size: 1rem;
  color: var(--phrond-text-primary);
}

.nav-dropdown-menu button.dropdown-item {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: 4px;
  background: transparent !important;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: inherit;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.site-nav .dropdown-item:hover,
.site-nav .dropdown-item:focus-visible {
  color: var(--phrond-sundial-gold);
  background: rgba(216, 202, 172, 0.12);
}
.nav-dropdown-menu form .account-menu-submit {
  all: unset;
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  color: var(--phrond-text-primary);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.nav-dropdown-menu form .account-menu-submit:hover,
.nav-dropdown-menu form .account-menu-submit:focus-visible {
  background: transparent !important;
  color: var(--phrond-sundial-gold);
}

.mobile-menu-toggle {
  z-index: 210;
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  border: 0;
  background: none;
  cursor: pointer;
}

.hamburger-bar {
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--phrond-sundial-gold);
}

.hero,
.page-intro {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.hero {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.feature-card,
.control-nav,
.controls-panel {
  border: 1px solid var(--phrond-border);
  background: var(--phrond-surface);
  box-shadow: none;
}

.hero-copy,
.hero-panel,
.feature-card,
.control-nav,
.controls-panel,
.control-card {
  border-radius: 8px;
}

.hero-copy {
  padding: clamp(1.8rem, 4vw, 4rem);
}

.hero-panel,
.feature-card,
.control-nav,
.controls-panel {
  padding: 1.4rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--phrond-sundial-gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
}

.lede {
  max-width: 60ch;
  color: var(--phrond-text-primary);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--phrond-tile-border);
  background: var(--phrond-btn-bg);
  color: var(--phrond-sundial-gold);
  font-family: var(--phrond-font-title);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: all 150ms ease;
}

.button-primary {
  color: var(--phrond-sundial-gold);
  background: var(--phrond-btn-bg);
}

.button-secondary {
  color: var(--phrond-sundial-gold);
  background: var(--phrond-btn-bg);
}

.button-ghost {
  color: var(--phrond-sundial-gold);
  background: transparent;
  border-color: transparent;
}

.button:hover {
  background: rgba(216, 202, 172, 0.15);
  border-color: #9e947d;
}

.button.is-selected {
  color: var(--phrond-sundial-gold);
  border-color: var(--phrond-sundial-gold);
  background: var(--phrond-selected);
}

.button-use-motif,
.btn-done-motif {
  background: linear-gradient(180deg, #07190e 0%, #030a05 100%);
  color: var(--flourish-highlight);
  border: 1px solid rgba(122, 156, 101, 0.45);
  font-size: 1.05rem;
  font-family: var(--phrond-font-title);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 150ms ease;
}

.button-use-motif:hover,
.btn-done-motif:hover {
  background: linear-gradient(180deg, #0d2c19 0%, #06160b 100%);
  color: #9ee079;
  border-color: #7a9c65;
  box-shadow: 0 0 10px rgba(122, 156, 101, 0.35);
}

.button-use-motif:active,
.btn-done-motif:active {
  background: linear-gradient(180deg, #05130b 0%, #020704 100%);
  color: #88d462;
  border-color: #5d8246;
}

.hero-panel p,
.control-nav h2 {
  margin-top: 0;
}

.hero-list,
.control-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-list li:first-child {
  border-top: 0;
}

.hero-list a {
  color: var(--phrond-accent-pale);
}

.section-grid,
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.page-card {
  display: block;
  padding: 1.4rem;
  border: 1px solid var(--phrond-border);
  border-radius: 6px;
  background: var(--phrond-surface);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
  transition: transform 150ms ease, border-color 150ms ease;
}

.page-card:hover {
  transform: translateY(-2px);
  border-color: var(--phrond-border-strong);
}
.page-card svg {
  width: 80%;
  height: 80%;
}

.page-card h2 {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
  text-align: center;
  color: var(--phrond-sundial-gold);
}

.page-card p {
  margin: 0;
  color: var(--phrond-text-primary);
  line-height: 1.65;
}
.card-preview {
  width: 70%;
  text-align: center;
  height: auto;
  margin: 0 auto;
}

.feature-card p,
.slider-head p {
  color: var(--phrond-text-primary);
  line-height: 1.65;
}

.controls-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.25rem;
}

.control-nav ul {
  display: grid;
  gap: 1rem;
}

.controls-panel {
  display: grid;
  gap: 1rem;
}

.panel-header {
  padding-bottom: 0.25rem;
}

.border-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.border-inspect-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.border-inspect-controls .material-icons {
  font-size: 1.1rem;
  vertical-align: middle;
}

.border-inspect-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--phrond-text-muted);
  font-size: 0.8rem;
}

.border-inspect-zoom select {
  min-height: 2rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--phrond-border);
  border-radius: 4px;
  color: var(--phrond-text-primary);
  background: var(--phrond-btn-bg);
}

.border-inspect-lens {
  position: absolute;
  z-index: 5;
  display: none;
  width: 164px;
  height: 164px;
  overflow: hidden;
  border: 2px solid var(--phrond-sundial-gold);
  border-radius: 4px;
  background: var(--phrond-surface-panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.border-inspect-lens.is-visible {
  display: block;
}

.border-inspect-lens svg {
  width: 100%;
  height: 100%;
}

.surface-preset-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--phrond-text-muted);
  font-size: 0.85rem;
}

.surface-preset-label select {
  min-width: 12rem;
  min-height: 2.2rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--phrond-border);
  border-radius: 4px;
  color: var(--phrond-text-primary);
  background: var(--phrond-btn-bg);
}

.motif-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: start;
}

.motif-type-grid {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.motif-preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 1rem;
  border: 1px solid var(--phrond-border);
  border-radius: 6px;
  background: var(--phrond-surface-panel);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
  overflow: visible;
}

.motif-preview-frame .mechanical-svg {
  width: min(100%, 300px);
  height: auto;
}

.motif-preview-frame .mechanical-run-svg {
  width: min(100%, 780px);
  max-width: 780px;
  height: auto;
  display: block;
}

.variant-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--phrond-border);
  border-radius: 6px;
  background: var(--phrond-btn-bg);
  color: var(--phrond-sundial-gold);
  font-family: var(--phrond-font-title);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.35rem;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.variant-pill:hover,
.variant-pill.is-selected {
  color: var(--phrond-sundial-gold);
  border-color: var(--phrond-border-strong);
  background: var(--phrond-selected);
}

.motif-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 80px;
  min-height: 0;
  height: auto;
  padding: 0.15rem 0.2rem;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.motif-card.is-selected {
  border-color: var(--phrond-sundial-gold);
  background: var(--phrond-selected);
}

.motif-card img,
.motif-card svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
}

.motif-card span {
  display: block;
  font-size: 0.7rem;
  line-height: 1;
  text-align: center;
  color: var(--phrond-text-primary);
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.motif-card:focus-visible {
  outline: 1px solid var(--phrond-accent-soft);
  outline-offset: 2px;
}

.variant-controls {
  display: grid;
  gap: 1rem;
}

.variant-controls.is-hidden {
  display: none;
}

.control-card {
  padding: 1.2rem;
  border: 1px solid var(--phrond-tile-border);
  background: rgba(0, 0, 0, 0.1);
}

.dual-scales-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

.scale-control-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.scale-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.scale-control-header .control-group-title {
  margin: 0;
}

.scale-control-output {
  font-size: 0.8rem;
  color: var(--phrond-text-muted);
}

.caption-controls {
  display: grid;
  gap: 0.55rem;
}

.slider-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.slider-head h2 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.slider-head p {
  margin: 0;
}

output {
  min-width: 5.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--phrond-tile-border);
  border-radius: 4px;
  text-align: center;
  color: white;
  font-weight: 700;
  background: var(--phrond-surface-panel);
}

.slider-wrap {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 1rem;
  color: var(--phrond-text-primary);
}

.slider-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--phrond-border);
  border-radius: 4px;
  background: var(--phrond-surface-panel);
  color: var(--phrond-text);
  cursor: pointer;
}

.slider-step:hover,
.slider-step:focus-visible {
  border-color: var(--phrond-accent-soft);
  background: var(--phrond-selected);
}

.check-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--phrond-text-primary);
}

.check-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

.check-wrap input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--phrond-accent-soft);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--flourish-highlight);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--phrond-tile-border);
  color: var(--phrond-text-muted);
  font-size: 0.875rem;
  opacity: 0.85;
}

.site-footer nav {
  display: block;
}

.site-footer a {
  color: var(--phrond-text-muted);
  transition: color 150ms ease, opacity 150ms ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--phrond-sundial-gold);
  opacity: 1;
}

@media (max-width: 900px) {
  .hero,
  .page-grid,
  .section-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .dual-scales-group {
    grid-template-columns: 1fr;
  }

  .motif-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding-inline: 1rem;
  }

  .brand-product-lockup {
    gap: 0.45rem;
  }

  .brand-title {
    font-size: 2.1rem;
  }

  .brand-product-separator {
    font-size: 1.65rem;
  }

  .brand-product-name {
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--phrond-tile-border);
    background: linear-gradient(180deg, #09190e 0%, #040d07 100%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.95);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-dropdown,
  .site-nav-btn {
    width: 100%;
  }

  .nav-dropdown-menu {
    position: static;
    display: none;
    width: 100%;
    margin-top: 0.5rem;
    background: var(--phrond-tile-bg);
    box-shadow: none;
  }

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    display: none;
  }

  .nav-dropdown.is-open > .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-menu::before {
    display: none;
  }
}

/* ==========================================================================
   Recycled Studio Layout & Border Controls
   ========================================================================== */

.controls-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.15rem;
  align-items: stretch;
}

.control-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: 1.4rem;
}

.sidebar-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sidebar-tool-icon {
  display: none !important;
}

.sidebar-collapse-toggle .material-icons {
  font-size: 1.35rem;
}

.controls-layout.is-sidebar-collapsed {
  grid-template-columns: 58px minmax(0, 1fr);
}

.controls-layout.is-sidebar-collapsed .control-nav {
  padding: 0.55rem;
}

.controls-layout.is-sidebar-collapsed .control-nav-section {
  display: none;
}

.controls-layout.is-sidebar-collapsed .sidebar-collapse-toggle {
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.65rem;
  height: 100%;
  padding: 0.75rem 0.35rem;
}

.controls-layout.is-sidebar-collapsed .sidebar-toggle-label {
  display: none;
}

.controls-layout.is-sidebar-collapsed .sidebar-tool-icon {
  display: inline-block !important;
}

@media (max-width: 820px) {
  .controls-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .controls-layout.is-sidebar-collapsed {
    grid-template-columns: 58px minmax(0, 1fr);
  }
}

.controls-panel-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.controls-panel {
  box-sizing: border-box;
  padding: 1.25rem;
  height: 100%;
}

.studio-view.controls-panel:not(.is-hidden) {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

.control-nav h2 {
  font-family: var(--phrond-font-title);
  font-size: 1.15rem;
  margin: 0 0 0.45rem 0;
  color: var(--phrond-sundial-gold);
}

.control-nav ul,
.motif-nav-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aesthetic-nav-grid {
  display: grid;
  gap: 0.45rem;
}

.control-nav .motif-nav-item {
  width: 100%;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0.6rem 0.85rem;
}

.control-nav .motif-nav-item.is-selected {
  border-color: var(--phrond-sundial-gold);
  background: var(--phrond-selected);
}

.control-nav-section {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--phrond-border);
}

.control-nav-section:first-child,
.sidebar-heading + .control-nav-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.control-nav .control-card {
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--phrond-tile-border);
  box-sizing: border-box;
  width: 100%;
}

.control-nav .slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.control-nav .slider-head h2 {
  font-size: 0.95rem;
  margin: 0;
}

.control-nav .slider-head output {
  min-width: 3.2rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
}

.color-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.color-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--phrond-text-muted);
  cursor: pointer;
}

.color-field > label,
.color-field > input[type="color"] {
  pointer-events: none;
}

.color-field > input[type="color"] {
  order: -1;
}

.color-field input[type="color"] {
  -webkit-appearance: none;
  width: 100%;
  height: 2.2rem;
  padding: 2px;
  border: 1px solid var(--phrond-tile-border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

[data-flourish-saved-color-set] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.4rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--phrond-tile-border);
  border-radius: 4px;
  background: var(--phrond-surface-panel);
  color: var(--phrond-text-primary);
  font: inherit;
}

.flourish-color-login-message {
  margin: 0.75rem 0 0;
  color: var(--phrond-text-muted);
  font-size: 0.78rem;
}

.flourish-draw-promo {
  margin: 0.65rem 0 0;
  color: var(--phrond-text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}

.flourish-draw-promo a {
  color: var(--phrond-sundial-gold);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.flourish-draw-promo a:hover,
.flourish-draw-promo a:focus-visible {
  color: var(--phrond-text-primary);
}

.flourish-color-dialog-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.flourish-color-dialog-header .field-label {
  margin: 0 0 0.2rem;
  color: var(--phrond-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.flourish-color-dialog-close {
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0.25rem;
  border-radius: 50%;
}

.flourish-color-dialog-controls {
  display: grid;
  gap: 0.6rem;
}

.flourish-color-dialog-controls label {
  display: grid;
  gap: 0.3rem;
  color: var(--phrond-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.flourish-color-hex {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--phrond-tile-border);
  border-radius: 4px;
  background: var(--phrond-surface-panel);
  color: var(--phrond-text-primary);
  font: inherit;
}

.flourish-color-dialog .button {
  font-size: 0.8rem;
}

.flourish-color-dialog input[type="range"] {
  width: 100%;
}

.flourish-color-dialog input[type="range"]::-webkit-slider-thumb,
.flourish-color-dialog input[type="range"]::-moz-range-thumb {
  box-shadow: none;
}

.studio-actions-grid {
  display: grid;
  gap: 0.5rem;
}

.studio-actions-grid .button {
  width: 100%;
}

.status-msg {
  font-size: 0.8rem;
  color: var(--phrond-sundial-gold);
  min-height: 1.2rem;
  text-align: center;
}

/* Border Canvas & Studio View Switcher */
.studio-view.is-hidden {
  display: none !important;
}

.motif-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.35rem;
}

.motif-config-header h2 {
  margin: 0 0 0.35rem 0;
}

.border-canvas-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 200ms ease;
  margin: 0;
  box-sizing: border-box;
}

.border-canvas-container.aspect-square {
  max-height: 410px;
  width: 100%;
}

.border-canvas-container.aspect-portrait {
  max-height: 420px;
  width: 100%;
}

.border-canvas-container.aspect-landscape {
  max-height: 410px;
  width: 100%;
}

.border-canvas-container.aspect-widescreen {
  max-height: 360px;
  width: 100%;
}

.border-canvas-container.is-collapsed-horizontal {
  aspect-ratio: 4 / 1 !important;
  max-height: 260px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.border-canvas-container svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
}

.border-tabs-nav {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--phrond-border);
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  width: 100%;
}

.border-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.35rem 0.1rem;
  font-family: var(--phrond-font-title);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--phrond-text-muted);
  cursor: pointer;
  transition: all 150ms ease;
  margin-bottom: -1px;
}

.border-tab-btn:hover {
  color: var(--phrond-text-primary);
}

.border-tab-btn:disabled {
  color: var(--phrond-text-muted);
  cursor: not-allowed;
  opacity: 0.4;
}

.border-tab-btn.is-active {
  color: var(--phrond-sundial-gold);
  border-bottom-color: var(--phrond-sundial-gold);
}

.border-tab-panel {
  width: 100%;
}

.border-tab-panel.is-hidden {
  display: none !important;
}

.flower-control-tab {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flower-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.flower-visual-column,
.flower-controls-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.flower-visual-column {
  position: sticky;
  top: 0.5rem;
}

.flower-visual-column .motif-preview-frame {
  min-height: 0;
  padding: 0.35rem;
  aspect-ratio: 1;
}

.flower-visual-column .mechanical-run-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.flower-workspace .motif-grid {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.flower-workspace .motif-card {
  width: 100%;
}

.flower-workspace .control-options-row {
  gap: 0.35rem 0.75rem;
}

.flower-controls-column .border-tabs-nav {
  margin: 0;
  border-bottom: 0;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.flower-controls-column .border-tab-btn {
  margin: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--phrond-tile-border);
  border-radius: 6px;
  background: transparent;
}

.flower-controls-column .border-tab-btn:hover,
.flower-controls-column .border-tab-btn.is-active {
  border-color: var(--phrond-sundial-gold);
  color: var(--phrond-sundial-gold);
  background: var(--phrond-selected);
}

@media (max-width: 760px) {
  .flower-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .flower-visual-column {
    position: static;
  }
}

.control-card h2,
.control-card h3,
.control-card label,
.control-card output,
.control-section-header h3,
.control-set h2,
.control-set h3,
.control-set label,
.control-set output,
.slider-head p,
.slider-wrap > span {
  font-size: 0.95rem;
}

.control-set {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--phrond-tile-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
}

.control-section-header h3,
.control-card h3,
.control-set h3 {
  font-family: var(--phrond-font-title);
  font-weight: 700;
  color: var(--phrond-sundial-gold);
  margin: 0 0 0.35rem;
}

.control-section-header,
.control-section-header h3 {
  margin: 0;
}

.control-set .control-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.control-set .control-card h2 {
  margin: 0 0 0.35rem;
}

.control-set.border-controls-bar {
  padding: 0.65rem;
}

.border-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  padding-top: 0.35rem;
}

.border-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
}

.control-group-title {
  font-family: var(--phrond-font-title);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phrond-sundial-gold);
  font-weight: 700;
}

.control-options-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.control-options-separator {
  color: var(--phrond-tile-border);
  font-weight: 300;
}

.rock-count-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.rock-count-controls [role="radiogroup"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.rock-count-controls h2 {
  margin: 0;
}

.plain-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--phrond-text-primary);
  cursor: pointer;
  user-select: none;
  transition: color 150ms ease;
}

.plain-check-label:hover {
  color: var(--phrond-sundial-gold);
}

.plain-check-label input[type="checkbox"],
.plain-check-label input[type="radio"] {
  accent-color: var(--phrond-sundial-gold);
  width: 17px;
  height: 17px;
  cursor: pointer;
  margin: 0;
}

.side-check-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: var(--phrond-btn-bg);
  border: 1px solid var(--phrond-tile-border);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--phrond-text-primary);
  cursor: pointer;
  user-select: none;
}

.side-check-btn input[type="checkbox"] {
  accent-color: var(--phrond-sundial-gold);
}

.segmented-control {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--phrond-tile-border);
}

.segment-btn {
  flex: 1;
  padding: 0.5rem 0.4rem;
  background: var(--phrond-btn-bg);
  border: none;
  color: var(--phrond-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: center;
}

.segment-btn.is-active {
  background: var(--phrond-selected);
  color: var(--phrond-sundial-gold);
}

.image-upload-row {
  display: flex;
  gap: 0.5rem;
}

.caption-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--phrond-tile-border);
  border-radius: 4px;
  background: #151a16;
  color: var(--phrond-text-primary);
  font-family: var(--phrond-font-body);
  font-size: 0.95rem;
}

.caption-input:focus {
  outline: none;
  border-color: var(--phrond-sundial-gold);
}

/* Editable slider readouts follow Annotate's numeric controls. */
.slider-value { box-sizing:border-box; width:4.5rem; min-width:0; padding:.2rem .3rem; border:1px solid var(--phrond-tile-border); border-radius:4px; color:var(--phrond-text-primary); background:var(--phrond-surface-panel); font:inherit; font-weight:700; text-align:center; appearance:textfield; }
.slider-value::-webkit-inner-spin-button, .slider-value::-webkit-outer-spin-button { appearance:none; margin:0; }
.control-nav .slider-head .slider-value { width:3.2rem; font-size:.85rem; }
