:root{
  font-family:Arial,"Microsoft JhengHei",sans-serif;
  color:#202b29;
  background:#f7f8f4;
  --ink:#202b29;
  --muted:#52635c;
  --line:#d5ddd5;
  --accent:#244f3e;
  --paper:#fff;
  --radius:8px;
  font-synthesis:none
}
*{
  box-sizing:border-box
}
body{
  margin:0
}
button,input,textarea,summary{
  font:inherit
}
button,summary{
  cursor:pointer
}
button{
  min-height:44px;
  border:1px solid var(--line);
  border-radius:6px;
  padding:10px 16px;
  background:#fff;
  color:var(--ink);
  font-weight:600;
  transition:background .15s,transform .15s,border-color .15s
}
button:hover:not(:disabled){
  background:#ecf1eb;
  border-color:#738f7f;
  transform:translateY(-1px)
}
button:active:not(:disabled){
  transform:translateY(1px)
}
button:disabled{
  cursor:not-allowed;
  color:#5b635d;
  background:#f1f2ef
}
button.primary{
  background:var(--accent);
  color:#fff;
  border-color:var(--accent)
}
button.primary:hover:not(:disabled){
  background:#183b2c
}
button.quiet{
  background:transparent;
  border-color:transparent;
  padding-inline:8px
}
button[aria-pressed=true]{
  border-color:var(--accent);
  box-shadow:inset 0 0 0 1px var(--accent);
  background:#eaf0e8
}
a{
  color:inherit
}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible{
  outline:3px solid #b65817;
  outline-offset:4px
}
.skip{
  position:absolute;
  left:16px;
  top:-80px;
  background:#fff;
  padding:14px;
  z-index:20
}
.skip:focus{
  top:12px
}
header{
  height:80px;
  border-bottom:1px solid var(--line);
  padding:0 max(24px,calc((100vw - 1280px)/2));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  background:#fff
}
.wordmark{
  font-size:20px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap
}
.mark{
  color:var(--accent);
  font-size:28px;
  vertical-align:middle
}
#project-title{
  font-size:14px;
  color:var(--muted);
  text-align:right
}
main{
  max-width:1280px;
  margin:auto;
  padding:38px 0 24px
}
.intro{
  display:flex;
  justify-content:space-between;
  gap:32px;
  align-items:end;
  margin-bottom:30px
}
.eyebrow{
  font-size:12px;
  font-weight:700;
  letter-spacing:.14em;
  color:var(--muted);
  margin:0 0 12px
}
h1{
  font-size:32px;
  letter-spacing:-.04em;
  font-weight:600;
  margin:0;
  line-height:1.35
}
h2{
  font-size:18px;
  margin:0;
  font-weight:600
}
.intro>p{
  font-size:14px;
  max-width:370px;
  margin:0;
  color:var(--muted);
  line-height:1.7
}
nav{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  border-block:1px solid var(--line);
  margin-bottom:28px;
  gap:8px
}
nav button{
  border:0;
  border-radius:0;
  background:transparent;
  text-align:left;
  min-height:60px;
  color:var(--muted);
  border-bottom:3px solid transparent
}
nav button[aria-current]{
  color:var(--accent);
  border-bottom-color:var(--accent)
}
#count{
  font-size:12px;
  margin-left:6px
}
.workspace{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);
  gap:40px
}
.preview-column,.palette-panel{
  min-width:0
}
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
  min-height:44px
}
.stage{
  padding:40px 30px;
  background:#e9ede7;
  border-radius:var(--radius);
  min-height:280px;
  display:grid;
  place-items:center
}
.card-frame{
  position:relative;
  width:100%;
  max-width:720px;
  isolation:isolate;
  overflow:hidden;
  box-shadow:0 12px 24px #182b261a;
  background:#ddd
}
.card-canvas{
  position:absolute;
  inset:0
}
.card-layer{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:fill;
  mask-size:100% 100%;
  mask-repeat:no-repeat;
  -webkit-mask-size:100% 100%;
  -webkit-mask-repeat:no-repeat
}
.card-frame.vertical{
  max-width:260px
}
.guide{
  position:absolute;
  border:1px dashed #00b6e0;
  pointer-events:none;
  z-index:3
}
.guide.safe{
  border-color:#ffb531
}
.current-colors{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin:22px 0
}
.current-colors>div{
  min-width:0;
  font-size:13px;
  line-height:1.6
}
.current-colors b{
  display:block;
  font-weight:600
}
.muted{
  color:var(--muted)
}
.dot{
  display:inline-block;
  width:12px;
  height:12px;
  margin-right:6px;
  border:1px solid #0003;
  vertical-align:middle
}
.color-id{
  display:block;
  font-family:monospace;
  font-size:12px;
  overflow-wrap:anywhere
}
.actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:16px 0
}
.screen-note{
  font-size:13px;
  color:var(--muted);
  line-height:1.6
}
details{
  border-top:1px solid var(--line);
  font-size:14px;
  line-height:1.8;
  margin-top:24px
}
summary{
  min-height:44px;
  padding:10px 0;
  font-weight:600
}
details p{
  color:var(--muted);
  margin:8px 0
}
details label{
  display:flex;
  align-items:center;
  gap:8px
}
input[type=checkbox]{
  width:20px;
  height:20px;
  flex-shrink:0
}
.palette-panel{
  border-left:1px solid var(--line);
  padding-left:32px
}
.palette-panel>h2{
  margin:12px 0 20px
}
.segmented{
  display:flex;
  gap:6px
}
.segmented button{
  flex:1;
  min-width:0;
  padding-inline:8px
}
.families{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:22px 0 12px
}
.families button{
  font-size:14px;
  padding:8px 12px;
  min-height:44px
}
.families button[aria-pressed=true]{
  background:var(--ink);
  color:#fff;
  border-color:var(--ink);
  box-shadow:none
}
#palette-help{
  font-size:13px;
  line-height:1.6;
  margin-bottom:14px
}
.swatches{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px
}
.swatch{
  display:flex;
  flex-direction:column;
  align-items:start;
  text-align:left;
  padding:10px;
  min-height:112px;
  gap:4px;
  position:relative
}
.swatch-color{
  width:100%;
  height:28px;
  border:1px solid #0002;
  border-radius:3px
}
.swatch-label{
  font-size:14px;
  line-height:1.5
}
.swatch small{
  font-size:11px;
  font-weight:400;
  overflow-wrap:anywhere;
  line-height:1.5
}
.swatch .reason{
  font-size:12px;
  color:#6c4227
}
.swatch:disabled .swatch-color{
  opacity:.6
}
.selected-label{
  position:absolute;
  right:14px;
  top:14px;
  background:#fff;
  color:var(--ink);
  padding:2px 6px;
  border-radius:3px;
  font-size:11px
}
.rule-note{
  font-size:13px;
  line-height:1.8;
  padding-top:14px;
  border-top:1px solid var(--line);
  color:var(--muted)
}
#status{
  padding:16px 20px;
  border-left:3px solid var(--accent);
  background:#eaf0e8;
  font-size:14px;
  margin-top:28px;
  line-height:1.7
}
#restore-error,#fatal{
  background:#fff1e7;
  color:#6b3614;
  padding:20px;
  border:1px solid #caa184;
  margin-bottom:24px;
  line-height:1.8
}
.warning{
  color:#794017;
  font-size:14px
}
.comparison-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:24px
}
.comparison{
  min-width:0;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  background:#fff
}
.comparison .stage{
  padding:16px;
  min-height:150px
}
.comparison h3{
  font-size:16px
}
.comparison p{
  font-size:13px;
  line-height:1.8;
  overflow-wrap:anywhere
}
.comparison .actions{
  margin-bottom:0
}
.empty{
  padding:40px 0;
  color:var(--muted)
}
.return-preview{
  width:100%;
  max-width:480px;
  padding:20px 0
}
#return>p{
  line-height:1.8
}
#return>h2{
  margin-bottom:16px
}
label{
  display:block;
  margin:12px 0 6px;
  font-size:14px
}
textarea{
  display:block;
  width:100%;
  max-width:100%;
  resize:vertical;
  line-height:1.7;
  font-size:14px;
  padding:14px;
  border:1px solid #9eafa1;
  border-radius:6px;
  background:white;
  color:var(--ink);
  overflow-wrap:anywhere
}
.import{
  max-width:800px
}
input[type=file]{
  max-width:100%;
  min-height:44px;
  font-size:14px
}
.import button{
  margin-top:12px
}
#exports{
  max-width:900px
}
footer{
  border-top:1px solid var(--line);
  margin-top:40px;
  padding-top:20px;
  display:flex;
  justify-content:space-between;
  gap:24px;
  color:var(--muted);
  font-size:12px;
  line-height:1.7
}
dialog{
  width:min(1100px,95vw);
  max-height:90vh;
  border:1px solid var(--line);
  border-radius:8px;
  padding:24px;
  color:var(--ink)
}
dialog::backdrop{
  background:#17261ed9
}
.zoom-scroll{
  overflow:auto;
  padding:16px;
  background:#e9ede7
}
#zoom-preview{
  min-width:850px
}
#zoom-preview .card-frame{
  max-width:none
}
#zoom-preview .vertical{
  max-width:450px;
  margin:auto
}
dialog p{
  font-size:13px
}
.mobile-only{
  display:none
}
[hidden]{
  display:none!important
}
@media(min-width:1360px){
  main{
    padding-inline:0
  }
}
@media(max-width:1359px){
  main{
    margin-inline:32px
  }
  header{
    padding-inline:32px
  }
}
@media(max-width:900px){
  .workspace{
    grid-template-columns:1fr;
    gap:28px
  }
  .palette-panel{
    border-left:0;
    border-top:1px solid var(--line);
    padding:16px 0 0
  }
  .swatches{
    grid-template-columns:repeat(3,minmax(0,1fr))
  }
  .comparison-grid{
    grid-template-columns:1fr
  }
  .comparison{
    max-width:700px
  }
  .mobile-only{
    display:block
  }
  .stage{
    min-height:220px
  }
  .intro{
    align-items:start
  }
  .intro>p{
    max-width:280px
  }
  .palette-panel>h2{
    margin-top:0
  }
}
@media(max-width:560px){
  header{
    padding:14px 16px;
    height:auto;
    min-height:80px;
    gap:8px;
    align-items:start;
    flex-direction:column
  }
  .wordmark{
    font-size:18px
  }
  #project-title{
    text-align:left;
    font-size:12px
  }
  main{
    margin-inline:16px;
    padding-top:28px
  }
  .intro{
    display:block;
    margin-bottom:24px
  }
  h1{
    font-size:26px
  }
  .intro>p{
    max-width:none;
    margin-top:16px
  }
  nav{
    gap:0;
    margin-bottom:20px
  }
  nav button{
    font-size:12px;
    padding:10px 4px;
    min-height:56px;
    line-height:1.6
  }
  #count{
    margin:0;
    display:block
  }
  .workspace{
    gap:24px
  }
  .stage{
    padding:24px 16px;
    min-height:180px
  }
  .current-colors{
    gap:8px;
    margin-top:16px
  }
  .current-colors b{
    font-size:12px
  }
  .current-colors .color-id{
    font-size:10px
  }
  .swatches{
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .swatch{
    min-height:118px
  }
  .families{
    gap:4px
  }
  .families button{
    padding-inline:11px
  }
  .actions>button{
    flex:1;
    min-width:120px
  }
  footer{
    flex-direction:column;
    gap:8px;
    margin-top:28px
  }
  dialog{
    padding:14px
  }
  .section-head{
    gap:8px
  }
  .screen-note{
    font-size:12px
  }
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    transition:none!important;
    animation:none!important;
    scroll-behavior:auto!important
  }
}
#preview{
  width:100%;
  display:flex;
  justify-content:center
}

/* Private layer review: full native canvas, without altering the shared tool layout. */
.review-scroll { overflow:auto; margin:20px 0; background:#e9ede7; padding:12px; }
#review-canvas { position:relative; max-width:none; margin:0 auto; }
#review-canvas img { display:block; width:100%; height:auto; top:0; left:0; }
.review-table { overflow:auto; margin:24px 0; }
.review-table table { border-collapse:collapse; width:100%; font-size:14px; }
.review-table th,.review-table td { border-bottom:1px solid var(--line); padding:12px; text-align:left; line-height:1.6; }
#findings,#pending { padding-left:24px; line-height:1.9; }
#review-status { padding:16px; border-left:3px solid var(--accent); background:#eaf0e8; line-height:1.7; margin:20px 0; }
#mode-description { line-height:1.8; }
@media(max-width:560px) { .review-table th,.review-table td { padding:8px; min-width:100px; } }

/* Step 03 is a self-contained screenshot card; advanced exports stay secondary. */
#return { scroll-margin-top:20px; }
.return-instruction { max-width:720px; color:var(--muted); }
.selection-card { max-width:720px; padding:24px; background:#fff; border:1px solid var(--line); border-radius:var(--radius); }
.selection-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.selection-card-head h3 { margin:0; font-size:22px; }
.selection-card-head>span { color:var(--accent); font-size:13px; white-space:nowrap; }
.selection-project { color:var(--muted); font-size:13px; margin:8px 0 0; }
.selection-card .return-preview { max-width:none; padding:18px 0; }
.selection-card .return-preview .card-frame { max-width:none; box-shadow:none; }
.selection-card .return-preview .vertical { max-width:180px; margin:auto; }
.selection-colors { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:0; }
.selection-color { min-width:0; display:flex; align-items:flex-start; gap:10px; }
.selection-chip { width:32px; height:32px; flex-shrink:0; border:1px solid #0003; border-radius:3px; }
.selection-color dt { font-size:12px; color:var(--muted); margin:0 0 3px; }
.selection-color dd { margin:0; }
.selection-color strong { display:block; font-size:14px; line-height:1.6; }
.selection-color-id { display:block; font-family:monospace; font-size:11px; line-height:1.7; overflow-wrap:anywhere; }
.selection-reference { color:var(--muted); font-size:11px; line-height:1.6; overflow-wrap:anywhere; margin:18px 0 0; }
.selection-disclaimer { color:var(--muted); border-top:1px solid var(--line); padding-top:10px; margin:10px 0 0; font-size:12px; line-height:1.6; }
#return-advanced { max-width:720px; }
@media(max-width:560px) {
  .selection-card { padding:16px; }
  .selection-card-head h3 { font-size:20px; }
  .selection-colors { grid-template-columns:1fr; gap:12px; }
  .selection-color { align-items:center; }
  .selection-color>div { flex:1; }
  .selection-color dt { display:inline; margin-right:8px; }
  .selection-color dd { display:inline; }
  .selection-color strong { display:inline; }
  .selection-chip { width:36px; height:36px; }
}
