﻿:root {
  --bg: #f4f6f8;
  --bg-2: #e7ebef;
  --ink: #050709;
  --ink-soft: #0d1116;
  --brand: #0c6b72;
  --brand-2: #f4a261;
  --card: #ffffff;
  --line: #d5dee6;
  --ok: #0b8f4d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Manrope, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, #cce3e5 10%, transparent 35%),
    radial-gradient(circle at 95% 5%, #ffe0c6 8%, transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

body.video-bg-page {
  background: #0c1117;
}

.global-video-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: saturate(1.08) contrast(1.08) brightness(0.88);
}

.global-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 20%, rgb(6 95 108 / 16%), transparent 34%),
    radial-gradient(circle at 92% 14%, rgb(245 158 11 / 13%), transparent 36%),
    radial-gradient(circle at 50% 28%, rgb(255 255 255 / 10%), rgb(255 255 255 / 2%) 54%, rgb(8 17 24 / 36%) 100%),
    linear-gradient(180deg, rgb(7 16 24 / 30%), rgb(8 18 26 / 18%) 28%, rgb(8 18 26 / 28%) 100%);
}

body.video-bg-page .site-header,
body.video-bg-page main,
body.video-bg-page .site-footer {
  position: relative;
  z-index: 2;
}

.container {
  width: min(1160px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: rgb(255 255 255 / 72%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f0f7f7;
  border: 1px solid #c7dde0;
  box-shadow: inset 0 0 0 1px #ffffff;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
}

.main-nav {
  display: flex;
  gap: 22px;
}

.main-nav a {
  color: #050709;
  text-decoration: none;
  font-weight: 700;
}

.admin-nav-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #050709;
  border-radius: 999px;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
}

.admin-nav-btn:hover {
  color: var(--brand);
  border-color: #a6c8cc;
}

.mobile-admin-btn {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #1f8a93);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgb(11 85 104 / 35%);
  cursor: pointer;
}

.main-nav a:hover {
  color: var(--brand);
}

.hero {
  padding: 80px 0 54px;
}

.eyebrow {
  color: #050709;
  font-weight: 800;
  letter-spacing: 0.35px;
  margin: 0 0 10px;
}

h1,
h2,
h3 {
  font-family: Sora, sans-serif;
  margin-top: 0;
}

h1 {
  font-size: clamp(32px, 4vw, 52px);
  margin-bottom: 14px;
}

.hero-copy {
  color: var(--ink-soft);
  max-width: 760px;
  line-height: 1.68;
  margin-bottom: 28px;
}

.cta {
  display: inline-block;
  padding: 13px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #0b5568);
  box-shadow: 0 10px 22px rgb(12 107 114 / 22%);
}

.tools {
  padding: 22px 0 58px;
}

body.video-bg-page .tools > .container {
  border: 1px solid rgb(202 218 228 / 84%);
  border-radius: 20px;
  padding: clamp(14px, 2.2vw, 24px);
  background: linear-gradient(180deg, rgb(255 255 255 / 14%), rgb(249 253 255 / 4%));
  box-shadow: 0 18px 40px rgb(7 24 33 / 22%);
  backdrop-filter: blur(10px);
}

body.video-bg-page .tools h2 {
  color: #050709;
}

body.video-bg-page .tools .eyebrow {
  color: #050709;
}

body.video-bg-page .tools .section-copy {
  color: #050709;
}

body.video-bg-page .tools,
body.video-bg-page .tools p,
body.video-bg-page .tools label,
body.video-bg-page .tools .history-values,
body.video-bg-page .tools .history-empty,
body.video-bg-page .about,
body.video-bg-page .about p,
body.video-bg-page .footer-inner,
body.video-bg-page .main-nav a,
body.video-bg-page .brand-text {
  color: #050709;
}

.section-copy {
  color: var(--ink-soft);
  margin-top: -6px;
  margin-bottom: 14px;
}

.tool-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  padding: 0;
  background: linear-gradient(135deg, #fff95a, #ffe600 55%, #ffd200);
  border-radius: 10px;
  border: 1px solid #d4bb00;
  scrollbar-width: thin;
}

.tool-tab {
  border: 0;
  border-right: 1px solid rgb(109 89 0 / 24%);
  background: transparent;
  color: #1a1300;
  border-radius: 0;
  padding: 7px 10px 8px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  min-width: 86px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  transition: background .18s ease;
}

.tool-tab:hover {
  background: rgb(0 0 0 / 8%);
}

.tool-tab.active {
  color: #fff;
  background: linear-gradient(180deg, #ff6f00, #ff3d00);
}

.tool-ico {
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
}

.tool-txt {
  font-size: 12px;
  line-height: 1.1;
  font-weight: 700;
}

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

.calc-stage {
  min-width: 0;
}

.calc-card {
  display: none;
  background: rgb(255 255 255 / 24%);
  border: 1px solid rgb(205 219 228 / 96%);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 28px rgb(19 32 41 / 12%);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.calc-card.active {
  display: block;
}

.calc-card:hover {
  transform: translateY(-1px);
  border-color: #b8d3df;
  box-shadow: 0 16px 34px rgb(19 32 41 / 16%);
}

.calc-card h3 {
  margin-bottom: 14px;
  font-size: 20px;
}

.calc-body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.calc-main {
  min-width: 0;
}

.mini-preview {
  border: 1px solid #c9dbe4;
  border-radius: 12px;
  background: linear-gradient(160deg, #f7fcff, #eef7fb);
  padding: 10px;
}

.mini-caption {
  color: #245769;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .25px;
  margin-bottom: 8px;
}

.mini-frame {
  position: relative;
  height: 176px;
  border: 1px solid #d5e6ee;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.mini-dim {
  position: absolute;
  font-size: 13px;
  font-weight: 800;
  color: #1e6ad5;
}

.mini-dim-top {
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
}

.mini-dim-right {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: #d34747;
}

.mini-figure {
  width: 128px;
  height: 96px;
  border-radius: 6px;
  background: linear-gradient(160deg, #ff3157, #ff003c 58%, #ff4b6f);
  border: 2px solid #d90443;
  transform: none;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.mini-sheet {
  background: linear-gradient(160deg, #ff3157, #ff003c 58%, #ff4b6f);
  box-shadow:
    inset 0 0 10px rgb(255 255 255 / 28%),
    0 0 12px rgb(255 0 60 / 35%);
}
.mini-rod {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  transform: none;
  background: radial-gradient(circle at 28% 28%, #72b6ef, #2d7fc4);
}
.mini-tube {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  transform: none;
  background: radial-gradient(circle at center, #ffffff 28%, #3a90d4 30%, #2f82c7 100%);
}
.mini-square {
  width: 96px;
  height: 96px;
  transform: none;
  background: linear-gradient(160deg, #4ea0e2, #2f85cb);
}
.mini-profile {
  width: 124px;
  height: 92px;
  clip-path: polygon(0 0, 100% 0, 100% 20%, 22% 20%, 22% 100%, 0 100%);
  transform: none;
  background: linear-gradient(160deg, #5fa7de, #2f82c6);
}

.mini-hex {
  width: 98px;
  height: 92px;
  clip-path: polygon(25% 6%, 75% 6%, 98% 50%, 75% 94%, 25% 94%, 2% 50%);
  background: linear-gradient(160deg, #46a0e0, #2b77be);
}

.mini-hollow {
  width: 122px;
  height: 90px;
  border-radius: 8px;
  background: linear-gradient(160deg, #ff3157, #ff003c 58%, #ff4b6f);
  border: 10px solid #2f86c8;
}

.mini-l {
  width: 120px;
  height: 94px;
  clip-path: polygon(0 0, 100% 0, 100% 18%, 22% 18%, 22% 100%, 0 100%);
  background: linear-gradient(160deg, #ff3157, #ff003c 58%, #ff4b6f);
}

.mini-t {
  width: 122px;
  height: 92px;
  clip-path: polygon(0 0, 100% 0, 100% 24%, 58% 24%, 58% 100%, 42% 100%, 42% 24%, 0 24%);
  background: linear-gradient(160deg, #ff3157, #ff003c 58%, #ff4b6f);
}

.mini-u {
  width: 122px;
  height: 92px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 74% 100%, 74% 26%, 26% 26%, 26% 100%, 0 100%);
  background: linear-gradient(160deg, #ff3157, #ff003c 58%, #ff4b6f);
}

.mini-i {
  width: 122px;
  height: 92px;
  clip-path: polygon(0 0, 100% 0, 100% 22%, 60% 22%, 60% 78%, 100% 78%, 100% 100%, 0 100%, 0 78%, 40% 78%, 40% 22%, 0 22%);
  background: linear-gradient(160deg, #ff3157, #ff003c 58%, #ff4b6f);
}

.mini-center-text {
  color: #fff;
  font-family: Sora, Manrope, sans-serif;
  font-size: clamp(14px, 1.5vw, 19px);
  font-weight: 800;
  font-style: normal;
  letter-spacing: .1px;
  text-shadow: 0 1px 3px rgb(0 0 0 / 22%);
  transform: none;
  z-index: 1;
}

.mini-note {
  margin-top: 8px;
  color: #2f4e5e;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #1a2832;
  font-size: 14px;
  font-weight: 700;
}

input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
}

input:focus {
  border-color: #69b4ba;
  outline: 2px solid rgb(105 180 186 / 18%);
}

select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
}

select:focus {
  border-color: #69b4ba;
  outline: 2px solid rgb(105 180 186 / 18%);
}

input[data-field="density"] {
  cursor: pointer;
}

.density-field-label .density-input-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.density-field-label .density-input-row input[data-field="density"] {
  flex: 0 0 96px;
  min-width: 96px;
}

.density-inline-material {
  color: #245769;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 170px;
}

.density-select-wrap {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.density-inline-search {
  width: 100%;
  border: 1px solid #b8d3de;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #133743;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.density-inline-search:focus {
  border-color: #69b4ba;
  outline: 2px solid rgb(105 180 186 / 18%);
}

.density-select-title {
  color: #245769;
  font-size: 13px;
  font-weight: 800;
}

.density-inline-select {
  width: 100%;
  border: 1px solid #b8d3de;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #133743;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  min-height: 46px;
  cursor: pointer;
  appearance: auto;
}

.density-inline-select option {
  padding: 6px 4px;
}

.material-picked {
  margin-top: 6px;
  color: #0b5568;
  font-size: 12px;
  font-weight: 800;
}

.calc-btn {
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--ink), #2f4a59);
  cursor: pointer;
}

.action-row {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-row .calc-btn {
  margin-top: 0;
}

.preview-btn {
  border: 1px solid #b8d7da;
  background: #eef9fa;
  color: #0b5568;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.preview-btn:hover {
  filter: brightness(0.98);
}

.calc-btn:hover {
  filter: brightness(1.08);
}

.result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d6e5ed;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fcff, #f2f8fb);
  color: var(--ink-soft);
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.result.ok {
  border-color: #95d8b2;
  background: linear-gradient(180deg, #f2fdf6, #eaf9f1);
}

.result-label {
  font-size: 13px;
  color: #376157;
  font-weight: 800;
}

.result-total {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
  color: #0f7a45;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.history-panel {
  background: rgb(255 255 255 / 24%);
  border: 1px solid rgb(205 219 228 / 96%);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 12px 28px rgb(19 32 41 / 12%);
  position: sticky;
  top: 92px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.history-panel:hover {
  transform: translateY(-1px);
  border-color: #b8d3df;
  box-shadow: 0 16px 34px rgb(19 32 41 / 16%);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.history-head h3 {
  margin: 0;
  font-size: 18px;
}

.clear-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
}

.history-list {
  max-height: 560px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fbfdff;
}

.history-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.history-type {
  font-weight: 800;
  color: var(--ink);
}

.history-time {
  color: var(--ink-soft);
  font-size: 12px;
}

.history-values {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.history-empty {
  color: var(--ink-soft);
  margin: 0;
}

.material-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.material-modal.open {
  display: block;
}

.material-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(11 22 29 / 52%);
}

.material-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 94vw);
  max-height: 82vh;
  background:
    radial-gradient(circle at 0 0, #eef8f9 0, #fff 34%),
    #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgb(7 24 33 / 28%);
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.material-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.material-head h3 {
  margin: 0;
  font-size: 18px;
}

.material-close {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 7px 10px;
  cursor: pointer;
}

.material-search {
  width: 100%;
  display: block;
  line-height: 1.3;
  padding-top: 11px;
  padding-bottom: 11px;
}

.material-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.material-count {
  font-size: 12px;
  font-weight: 800;
  color: #0b5568;
  background: #e7f6f7;
  border: 1px solid #b7dfe2;
  border-radius: 999px;
  padding: 4px 8px;
}

.material-tip {
  color: var(--ink-soft);
  font-size: 12px;
}

.material-list {
  overflow: auto;
  border: 1px solid #cadbe4;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 9px;
}

.material-row {
  width: 100%;
  border: 1px solid #d3e4eb;
  background: linear-gradient(180deg, #ffffff, #f9fcfe);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.material-row:hover {
  border-color: #8fc6cb;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgb(11 85 104 / 10%);
}

.material-name {
  font-weight: 800;
  color: var(--ink);
  text-align: left;
}

.material-density {
  color: #0b5568;
  font-weight: 800;
}

.material-empty {
  color: var(--ink-soft);
  padding: 10px;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: none;
}

.preview-modal.open {
  display: block;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(11 22 29 / 60%);
}

.preview-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1180px, 98vw);
  max-height: 94vh;
  background:
    radial-gradient(circle at 0 0, #eef8f9 0, #fff 34%),
    #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgb(7 24 33 / 28%);
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
  gap: 9px;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-head h3 {
  margin: 0;
  font-size: 20px;
}

.preview-subline {
  color: var(--ink-soft);
  font-size: 13px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-step-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #b4d3df;
  background: linear-gradient(140deg, #f7fdff, #ecf8fb);
  color: #0f5f74;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 6px 10px;
}

.preview-replay-btn {
  border: 1px solid #b8d4df;
  background: #fff;
  color: #245465;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}

.preview-replay-btn:hover {
  transform: translateY(-1px);
  border-color: #7db6c8;
  color: #0d5468;
}

.preview-guide {
  min-height: 31px;
  border: 1px solid #bfdde8;
  background: linear-gradient(140deg, #f5fdff, #eef8fc);
  border-radius: 10px;
  padding: 7px 11px;
  color: #0d5567;
  font-size: 13px;
  font-weight: 700;
}

.preview-dims {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.preview-dim-item {
  border: 1px solid #cfe1e8;
  background: linear-gradient(160deg, #fff, #f9fcfd);
  border-radius: 10px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all .22s ease;
  border-left-width: 4px;
}

.preview-dim-item.active {
  border-color: #7fbecd;
  box-shadow: 0 7px 20px rgb(32 116 136 / 16%);
  transform: translateY(-1px);
}

.preview-dim-item.accent-blue {
  border-left-color: #1d7dd7;
}
.preview-dim-item.accent-blue .preview-dim-val {
  color: #145da1;
}

.preview-dim-item.accent-red {
  border-left-color: #dc3e42;
}
.preview-dim-item.accent-red .preview-dim-val {
  color: #a5292d;
}

.preview-dim-item.accent-green {
  border-left-color: #1f9d55;
}
.preview-dim-item.accent-green .preview-dim-val {
  color: #196e3e;
}

.preview-dim-item.accent-steel {
  border-left-color: #0a6f88;
}
.preview-dim-item.accent-steel .preview-dim-val {
  color: #1a4f62;
}

.preview-dim-key {
  font-size: 11px;
  color: #62808d;
  text-transform: uppercase;
  letter-spacing: .45px;
}

.preview-dim-val {
  font-size: 13px;
  color: #123949;
  font-weight: 800;
}

.preview-scale {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-scale-label {
  color: #446170;
  font-size: 12px;
  min-width: 62px;
}

.preview-scale-bar {
  height: 8px;
  width: 90px;
  border-radius: 99px;
  background: linear-gradient(90deg, #0e6f87, #27a7bc);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 55%);
  transition: width 0.16s ease;
}

.preview-canvas-wrap {
  position: relative;
  border: 1px solid #cadbe4;
  border-radius: 12px;
  background: #ffffff;
  min-height: 560px;
  height: 72vh;
  overflow: hidden;
}

.preview-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.preview-edge-leader {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  transform-origin: 0 50%;
  background: #8ba2b0;
  opacity: 0;
  border-radius: 99px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 18%);
  transition: opacity .16s ease, width .16s ease, transform .16s ease, background .16s ease;
}

.preview-edge-leader::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 6px;
  height: 6px;
  border-top: 2px solid currentcolor;
  border-right: 2px solid currentcolor;
  opacity: .95;
}

.preview-edge-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  background: rgb(255 255 255 / 96%);
  color: #214453;
  border: 1px solid #c7dde6;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1px;
  box-shadow: 0 6px 18px rgb(19 80 100 / 17%);
  white-space: nowrap;
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease, border-color .18s ease, color .18s ease;
}

.preview-edge-label.active {
  border-color: #79b7c8;
  color: #0f6177;
}

.preview-edge-label.accent-blue {
  border-color: #7db8ef;
  color: #145da1;
}
.preview-edge-leader.accent-blue {
  color: #2f91e8;
  background: #2f91e8;
}

.preview-edge-label.accent-red {
  border-color: #ef9fa2;
  color: #a5292d;
}
.preview-edge-leader.accent-red {
  color: #e0555a;
  background: #e0555a;
}

.preview-edge-label.accent-green {
  border-color: #8fd9ae;
  color: #196e3e;
}
.preview-edge-leader.accent-green {
  color: #2aa567;
  background: #2aa567;
}

.preview-edge-label.accent-steel {
  border-color: #c7dde6;
  color: #214453;
}
.preview-edge-leader.accent-steel {
  color: #5d8698;
  background: #5d8698;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}

.admin-modal.open {
  display: block;
}

.admin-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(10 24 33 / 55%);
}

.admin-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(840px, 96vw);
  max-height: 86vh;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgb(7 24 33 / 28%);
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-head h3 {
  margin: 0;
}

.admin-auth p {
  margin: 0 0 10px;
}

.admin-auth-row {
  display: flex;
  gap: 10px;
}

.admin-auth-row input {
  width: 160px;
}

.admin-error {
  min-height: 18px;
  color: #b42318;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.admin-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  min-height: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 10px;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
}

.admin-btn-primary {
  background: linear-gradient(135deg, var(--brand), #1f8a93);
  border-color: transparent;
  color: #fff;
}

.admin-rows {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.admin-row {
  border: 1px solid #d6e2e8;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 90px;
  gap: 8px;
  align-items: center;
}

.admin-row input {
  width: 100%;
}

.admin-row-delete {
  border: 1px solid #f1c3bf;
  background: #fff5f4;
  color: #b42318;
  border-radius: 10px;
  font-weight: 800;
  padding: 8px;
  cursor: pointer;
}

.admin-pin-change {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-pin-change label {
  flex: 1;
  min-width: 220px;
}

.admin-note {
  color: var(--ink-soft);
  font-size: 13px;
}

.about {
  padding: 26px 0 50px;
}

body.video-bg-page .about > .container {
  border: 1px solid rgb(202 218 228 / 80%);
  border-radius: 18px;
  padding: clamp(14px, 2vw, 20px);
  background: linear-gradient(180deg, rgb(255 255 255 / 12%), rgb(248 252 255 / 2%));
  box-shadow: 0 16px 34px rgb(7 24 33 / 18%);
  backdrop-filter: blur(8px);
}

body.video-bg-page .about h2 {
  color: #050709;
}

body.video-bg-page .about p {
  color: #070b10;
}

.about.about-with-video {
  position: relative;
  overflow: hidden;
  border-top: 1px solid #d7e1e8;
  border-bottom: 1px solid #d7e1e8;
}

.about.about-with-video .about-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: saturate(1.08) contrast(1.08) brightness(0.86);
}

.about.about-with-video .about-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgb(6 95 108 / 18%), transparent 34%),
    radial-gradient(circle at 88% 20%, rgb(245 158 11 / 16%), transparent 38%),
    linear-gradient(180deg, rgb(247 251 253 / 28%), rgb(240 245 249 / 34%));
}

.about.about-with-video .about-content-inner {
  position: relative;
  z-index: 2;
}

.about.about-with-video h2,
.about.about-with-video p {
  text-shadow: 0 1px 0 rgb(255 255 255 / 45%);
}

.about p {
  max-width: 920px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 65%);
}

.footer-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-weight: 700;
}

@media (max-width: 1020px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .calc-body {
    grid-template-columns: 1fr;
  }

  .mini-preview {
    order: 2;
  }

  .history-panel {
    position: static;
  }

  .about.about-with-video {
    padding-top: 20px;
    padding-bottom: 30px;
  }

  body.video-bg-page .tools > .container,
  body.video-bg-page .about > .container {
    border-radius: 14px;
    padding: 14px;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .header-inner {
    min-height: 62px;
  }

  .brand-text {
    font-size: 14px;
  }

  .main-nav {
    display: none;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .mini-frame {
    height: 160px;
  }

  .mini-figure {
    width: 112px;
    height: 86px;
  }

  .mini-rod,
  .mini-tube,
  .mini-square {
    width: 78px;
    height: 78px;
  }

  .mini-profile {
    width: 112px;
    height: 82px;
  }

  .mini-hollow,
  .mini-l,
  .mini-t,
  .mini-u,
  .mini-i {
    width: 110px;
    height: 82px;
  }

  .mini-hex {
    width: 88px;
    height: 82px;
  }

  .result-total {
    font-size: 38px;
  }

  .preview-panel {
    inset: 0;
    left: 0;
    top: 0;
    transform: none;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding: 10px;
    grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
  }

  .preview-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .preview-replay-btn {
    width: 100%;
    min-height: 36px;
  }

  .preview-guide {
    font-size: 12px;
    min-height: 28px;
  }

  .preview-dims {
    grid-template-columns: 1fr;
  }

  .preview-dim-item {
    padding: 6px 8px;
  }

  .preview-scale-label {
    min-width: 74px;
  }

  .preview-canvas-wrap {
    min-height: 360px;
    height: 58vh;
  }

  .preview-edge-label {
    font-size: 11px;
    padding: 3px 8px;
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    padding: 12px 0;
    gap: 4px;
  }
}

@media (min-width: 701px) {
  .mobile-admin-btn {
    display: none;
  }
}

