:root {
  --navy: #1B3D63;
  --navy2: #244a75;
  --orange: #F08A24;
  --bg: #FAF7F2;
  --text: #1a2b3c;
  --muted: #5a6b7d;
  --line: rgba(27, 61, 99, 0.12);
  --white: #fff;
  --safe-b: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #e7e2da; color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 15px;
}
button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
.app {
  max-width: 430px; min-height: 100vh; margin: 0 auto; background: var(--bg);
  position: relative; box-shadow: 0 0 40px rgba(27,61,99,.12);
}
.view { display: none; padding: 16px 14px 28px; }
.view.on { display: block; }
.view.edit { padding-bottom: 92px; }
.brand-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.brand-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #fff; }
.brand-name { font-size: 18px; font-weight: 800; color: var(--navy); }
.brand-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.top-auth { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.top-auth-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-line { font-weight: 800; color: var(--navy); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal { font-size: 13px; color: var(--muted); font-weight: 600; background: rgba(27,61,99,.06); padding: 6px 10px; border-radius: 999px; }
.login-entry { font-weight: 800; color: #fff; background: var(--orange); border: 0; border-radius: 999px; padding: 8px 14px; }
.card, .vis-card, .promo, .attr-card, .ctrl-card {
  background: var(--white); border-radius: 12px; border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(27,61,99,.05);
}
.vis-card { padding: 14px 12px; margin-bottom: 12px; }
.vis-head, .head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vis-title, .page-title { font-size: 18px; font-weight: 800; color: var(--navy); }
.chip {
  border: 0; background: rgba(27,61,99,.06); color: var(--muted); border-radius: 999px;
  padding: 6px 10px; font-size: 12px; font-weight: 700;
}
.vis-search { position: relative; margin-top: 12px; }
.vis-inp, .field, .lib-search, .inp {
  width: 100%; height: 44px; border: 1px solid rgba(27,61,99,.32); border-radius: 12px;
  padding: 0 40px 0 12px; font-size: 16px; background: #fbfdfc; color: var(--text);
}
.field, .lib-search, .inp { padding-right: 12px; background: #fff; }
.vis-drop {
  position: absolute; right: 0; top: 0; width: 44px; height: 44px; border: 0; background: transparent;
}
.caret { width: 0; height: 0; margin: 0 auto; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid var(--navy); }
.caret.open { transform: rotate(180deg); }
.hist-pop {
  position: absolute; left: 0; right: 0; top: 50px; z-index: 20; background: #fff;
  border: 1px solid rgba(27,61,99,.14); border-radius: 12px; box-shadow: 0 8px 24px rgba(20,40,60,.14);
}
.hist-head, .hist-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
.hist-head { font-weight: 800; color: var(--navy); font-size: 13px; }
.hist-row { border-top: 1px solid rgba(27,61,99,.08); }
.hist-name { flex: 1; text-align: left; border: 0; background: none; font-size: 14px; }
.link-del { border: 0; background: none; color: #dc2626; font-weight: 700; font-size: 12px; }
.vis-btns { display: flex; gap: 10px; margin-top: 14px; }
.vis-btn-wrap { flex: 1; position: relative; min-width: 0; }
.vis-q {
  position: absolute; right: 4px; top: -6px; z-index: 2; width: 20px; height: 20px; border-radius: 99px;
  border: 0; background: #fff; color: var(--navy); font-weight: 800; box-shadow: 0 1px 4px rgba(27,61,99,.15);
}
.vis-btn, .btn-primary, .btn-ghost, .btn-sec {
  width: 100%; border-radius: 12px; font-weight: 800; border: 0;
}
.vis-btn { height: 48px; font-size: 16px; color: #fff; }
.vis-btn.basic { background: linear-gradient(135deg, #244a73, #1B3D63); }
.vis-btn.full { background: linear-gradient(135deg, #f3a04a, #F08A24); }
.vis-free { margin-top: 6px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }
.vis-cmp { margin-top: 12px; display: flex; gap: 6px; background: rgba(27,61,99,.04); border-radius: 10px; padding: 10px 6px; }
.vis-cmp-col { flex: 1; text-align: center; }
.vis-cmp-h { font-size: 13px; font-weight: 800; color: var(--navy); line-height: 1.4; }
.vis-cmp-b { font-size: 12px; color: var(--text); line-height: 1.45; margin-top: 4px; }
.promo {
  display: flex; align-items: center; gap: 10px; padding: 12px; margin: 12px 0;
  background: linear-gradient(135deg, #e8eef5, #fff); border: 1px solid rgba(27,61,99,.18); width: 100%; text-align: left;
}
.promo-t { font-weight: 700; color: var(--navy); font-size: 14px; }
.promo-d { color: var(--muted); font-size: 13px; margin-top: 4px; }
.promo-go { flex-shrink: 0; color: #fff; background: var(--orange); border-radius: 99px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.hero { text-align: center; margin: 18px 0 12px; }
.hero-title { font-size: 22px; font-weight: 800; color: var(--navy); }
.hero-sub, .hint, .lead { color: var(--muted); line-height: 1.6; }
.btn-primary { background: linear-gradient(135deg, var(--navy), var(--navy2)); color: #fff; padding: 14px 12px; font-size: 16px; margin-top: 8px; }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); padding: 12px; font-size: 15px; margin-top: 8px; }
.btn-sec { background: #fff; color: var(--orange); border: 2px solid var(--orange); padding: 12px; margin-top: 8px; }
.btn-primary:disabled, .vis-btn:disabled, .btn-ghost:disabled { opacity: .65; }
.sec-title { font-weight: 800; color: var(--navy); margin: 8px 0; }
.lib-search { margin: 8px 0; }
.lib-board { display: flex; gap: 8px; align-items: stretch; }
.lib-col { flex: 1; min-width: 0; background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 10px 8px; }
.lib-col.work { border-color: rgba(240,138,36,.7); background: #fffaf4; }
.lib-h { font-weight: 800; color: var(--navy); }
.lib-col.work .lib-h { color: #c2410c; }
.lib-sub { font-size: 12px; color: var(--muted); min-height: 36px; margin: 4px 0 8px; }
.lib-scroll { max-height: 46vh; overflow: auto; }
.lib-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 16px 4px; }
.lib-item { padding: 8px 2px 10px; border-top: 1px solid rgba(27,61,99,.08); }
.lib-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-meta, .lib-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lib-time { color: #9a3412; }
.lib-tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; color: #b45309; background: rgba(240,138,36,.12); border-radius: 6px; padding: 1px 6px; }
.lib-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.lib-act { border: 0; background: rgba(27,61,99,.08); color: var(--navy); border-radius: 8px; padding: 4px 6px; font-size: 12px; font-weight: 700; }
.lib-act.del { color: #dc2626; background: #fee2e2; }
.back { border: 0; background: none; color: var(--navy); font-weight: 800; padding: 0 0 10px; }
.attr-card, .ctrl-card, .card { padding: 12px; margin-bottom: 10px; }
.fld { margin-bottom: 8px; }
.lab { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.attr-grid, .ctrl-row { display: flex; gap: 8px; align-items: center; }
.attr-grid .fld { flex: 1; }
.ctrl-card { display: flex; gap: 8px; align-items: stretch; }
.ctrl-main { flex: 1; }
.ctrl-row { margin-bottom: 8px; }
.ctrl-mid { display: flex; align-items: center; gap: 8px; }
.step, .size-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 800; color: var(--navy);
}
.pink-btn {
  width: 64px; border: 0; background: #f3e7ea; color: #9f1239; font-weight: 800; border-radius: 8px; line-height: 1.2;
}
.pink-btn.on { background: #fb7185; color: #fff; }
.shape-toggle { display: flex; gap: 8px; margin-bottom: 10px; }
.shape-btn {
  flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px; font-weight: 700; color: var(--navy);
}
.shape-btn.on { border-color: var(--navy); background: #e8eef5; }
.ico-sq, .ico-rect, .ico-ci { margin: 6px auto 0; border: 2px solid var(--navy); }
.ico-sq { width: 16px; height: 16px; }
.ico-rect { width: 22px; height: 14px; }
.ico-ci { width: 16px; height: 16px; border-radius: 50%; }
.fullcard-btn {
  width: 100%; border: 0; border-radius: 12px; padding: 12px; color: #fff;
  background: linear-gradient(135deg, #0f766e, #115e59); margin-bottom: 10px;
}
.fullcard-btn .sub { display: block; font-size: 12px; font-weight: 500; opacity: .9; margin-top: 4px; }
.sheet-wrap { background: #fff; border-radius: 12px; padding: 10px; border: 1px solid var(--line); }
.sheet-top { display: flex; gap: 8px; align-items: flex-start; }
.sheet-top.swap { flex-direction: row-reverse; }
.top-col { flex: 1; min-width: 0; }
.model-dash { width: 100%; border: 0; border-bottom: 1px dashed #94a3b8; font-weight: 800; font-size: 18px; padding: 4px 0; background: transparent; }
.size-ops { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.mini-link, .swap-btn, .tool-clear { border: 0; background: rgba(27,61,99,.08); color: var(--navy); border-radius: 8px; padding: 4px 8px; font-weight: 700; font-size: 12px; }
.top-mid { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.logo-box { min-height: 48px; display: flex; align-items: center; justify-content: center; }
.sheet-logo { max-width: 100%; object-fit: contain; }
.sheet-logo.ph { color: var(--muted); border: 1px dashed #cbd5e1; width: 100%; text-align: center; padding: 12px 0; border-radius: 8px; }
.grid { display: grid; gap: 8px; margin-top: 12px; }
.cell {
  position: relative; background: #f8fafc; border: 1px dashed #94a3b8; overflow: hidden; aspect-ratio: 1;
}
.cell.rect { aspect-ratio: 1 / 0.72; }
.cell.circle { border-radius: 50%; }
.cell.filled { border-style: solid; border-color: #d4c4b0; }
.cell-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.plus { font-size: 22px; color: var(--navy); }
.meta { text-align: center; margin-top: 4px; }
.meta .code { font-weight: 700; font-size: 13px; }
.meta .name, .edit-tip { font-size: 12px; color: var(--muted); }
.ins { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.ins-btn { border: 0; background: #eef2f7; border-radius: 6px; font-size: 11px; padding: 3px 5px; color: var(--navy); font-weight: 700; }
.ins-btn.danger { background: #fee2e2; color: #dc2626; }
.add-slot .cell { border-style: dashed; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--navy); background: #fff; }
.add-cap { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.bar {
  position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 14px calc(10px + var(--safe-b));
  background: rgba(250,247,242,.96); border-top: 1px solid var(--line); margin: 0 -14px;
}
.bar button { margin-top: 0; flex: 1; padding: 12px 6px; font-size: 14px; }
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.mask[hidden] { display: none; }
.sheet-modal, .flow-card, .preview-sheet, .rpt-sheet {
  width: min(430px, 100%); background: #fff; border-radius: 16px 16px 0 0; padding: 16px 14px calc(16px + var(--safe-b));
  max-height: 92vh; overflow: auto;
}
.modal-title, .flow-title, .preview-title { font-size: 18px; font-weight: 800; color: var(--navy); }
.flow-card, .preview-sheet { margin: auto 0 0; }
.center-mask { align-items: center; }
.center-mask .flow-card { border-radius: 16px; margin: 16px; width: min(380px, calc(100% - 32px)); }
.flow-step { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.flow-dot {
  width: 22px; height: 22px; border-radius: 50%; background: #e2e8f0; color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.flow-step.done .flow-dot { background: #16a34a; color: #fff; }
.flow-step.run .flow-dot { background: var(--orange); color: #fff; }
.flow-plats { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px 30px; }
.flow-plat { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: #f1f5f9; color: var(--muted); }
.flow-plat.done { background: #dcfce7; color: #166534; }
.flow-plat.run { background: #ffedd5; color: #9a3412; }
.flow-bar { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.flow-bar-in { height: 100%; background: var(--orange); width: 0; }
.flow-foot, .flow-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.code-row { display: flex; gap: 8px; align-items: flex-end; }
.code-row .fld { flex: 1; }
.code-btn { height: 44px; border-radius: 12px; border: 1px solid var(--navy); background: #fff; color: var(--navy); font-weight: 700; padding: 0 10px; }
.or { text-align: center; color: var(--muted); margin: 12px 0; font-size: 13px; }
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack-chip { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 4px; text-align: center; }
.chip-price { font-weight: 800; color: var(--navy); }
.chip-sub { font-size: 12px; color: var(--muted); }
.custom-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.yen { font-weight: 800; color: var(--navy); }
.custom-inp { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 10px; }
.num { font-size: 32px; font-weight: 800; color: var(--navy); }
.help-tile, .tier, .h-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 8px; background: #fff; width: 100%; text-align: left; }
.tier-tag { display: inline-block; font-size: 12px; font-weight: 800; color: var(--navy); background: #e8eef5; border-radius: 99px; padding: 2px 8px; }
.tier-tag.free { background: #dcfce7; color: #166534; }
.tier-tag.flag { background: #ffedd5; color: #9a3412; }
.ta { width: 100%; min-height: 140px; border-radius: 12px; border: 1px solid var(--line); padding: 10px; font-size: 15px; }
.count { text-align: right; color: var(--muted); font-size: 12px; }
.plat { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plat-h { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.nm { display: inline-block; margin: 4px 4px 0 0; padding: 2px 6px; background: #f1f5f9; border-radius: 6px; font-size: 12px; }
.nm.self { background: #ffedd5; color: #9a3412; font-weight: 800; }
.preview-img, .rpt-img { width: 100%; border-radius: 8px; background: #f8fafc; }
.preview-head, .rpt-head { display: flex; justify-content: space-between; align-items: center; }
.x { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--navy); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80;
  background: rgba(15,23,42,.88); color: #fff; padding: 10px 14px; border-radius: 10px; max-width: 86vw; text-align: center;
}
.toast[hidden] { display: none; }
.roi-screen {
  position: fixed; inset: 0; z-index: 50; background: #0f172a; color: #fff; display: flex; flex-direction: column;
}
.roi-screen[hidden] { display: none; }
.roi-head { padding: 12px 14px 8px; }
.roi-scroll { flex: 1; overflow: auto; }
.roi-preview { position: relative; }
.roi-preview img { width: 100%; display: block; }
.roi-dim { position: absolute; background: rgba(15,23,42,.45); }
.roi-box { position: absolute; border: 2px solid #fb923c; }
.roi-tag {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%); background: #fb923c; color: #1c1917;
  font-size: 12px; font-weight: 800; border-radius: 99px; padding: 4px 8px; white-space: nowrap;
}
.roi-handle { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid #fb923c; border-radius: 4px; }
.roi-handle.tl { left: -9px; top: -9px; }
.roi-handle.tr { right: -9px; top: -9px; }
.roi-handle.bl { left: -9px; bottom: -9px; }
.roi-handle.br { right: -9px; bottom: -9px; }
.roi-dock { padding: 10px 14px calc(10px + var(--safe-b)); background: #111827; }
.danger { color: #dc2626; }
.note { font-size: 12px; color: var(--muted); line-height: 1.55; }
.ver { text-align: center; color: #94a3b8; font-size: 12px; margin-top: 18px; }
@media (min-width: 900px) {
  body { padding: 24px 0; }
}

/* site mode */
[data-tool][hidden]{display:none!important}
.akk-tool-recommend .ver,.akk-tool-ecolor .ver{opacity:.7}
