/* ==========================================================================
   Seller CS Studio · dicekorea.com
   해외 구매자 문의 다국어 템플릿 & 관세 안내기
   외부 CDN·폰트 의존성 없음. CSP `default-src 'self'; style-src 'self';
   script-src 'self'` 환경에서 그대로 동작합니다. (인라인 script/style 0개)
   ========================================================================== */

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

:root {
  --bg: #F4F7FC;
  --surface: #FFFFFF;
  --surface-2: #F8FAFE;
  --ink: #0F172A;
  --ink-2: #3B4A63;
  --muted: #6B7A90;
  --line: #E3E9F4;
  --line-soft: #EEF2F9;
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-soft: #EDF3FF;
  --green: #0E9F6E;
  --green-soft: #E7F8F0;
  --amber: #B45309;
  --amber-soft: #FEF5E7;
  --red: #D92D20;
  --red-soft: #FEECEB;
  --violet: #6D28D9;
  --violet-soft: #F3EEFF;
  --radius-lg: 20px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 38px -28px rgba(15, 23, 42, .45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
          "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 16px; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(150deg, #3B82F6, #1D4ED8);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .8);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand__text small { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

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

.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: #EEF2F9; border-radius: 11px;
}
.seg button {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
  color: var(--muted); padding: 6px 11px; border-radius: 8px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.seg button:hover { color: var(--ink-2); }
.seg button[aria-pressed="true"] {
  background: var(--surface); color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.seg--wide { display: flex; flex-wrap: wrap; width: 100%; }
.seg--wide button { flex: 1 1 0; padding: 8px 6px; font-size: 12px; text-align: center; }
.seg--four button { flex: 1 1 0; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer;
  padding: 9px 15px; border-radius: 10px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .1s ease;
}
.btn:hover { border-color: #C8D5EC; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .62; }
.btn--primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 8px 18px -12px rgba(37, 99, 235, .95);
}
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: #EEF2F9; color: var(--ink-2); }
.btn--sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { width: 100%; padding: 12px 18px; font-size: 14.5px; border-radius: 12px; }
.btn--wide { width: 100%; }
.btn--danger { color: var(--red); border-color: #F4D3D0; background: #fff; }
.btn--danger:hover { background: var(--red-soft); border-color: #EFC4C0; }
.btn[aria-pressed="true"] { background: var(--brand-soft); border-color: #C7DBFF; color: var(--brand-dark); }

#btnCompose.is-loading::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- pills ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.pill--green { background: var(--green-soft); color: var(--green); }
.pill--amber { background: var(--amber-soft); color: var(--amber); }
.pill--red { background: var(--red-soft); color: var(--red); }
.pill--blue { background: var(--brand-soft); color: var(--brand); }
.pill--violet { background: var(--violet-soft); color: var(--violet); }
.pill--grey { background: #EEF2F9; color: var(--muted); }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- hero ---------- */

.hero { padding: 42px 0 6px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .13em;
  color: var(--brand); text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--brand);
}
.hero h1 {
  margin-top: 14px;
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.24; letter-spacing: -.035em; font-weight: 700;
  max-width: 22em; word-break: keep-all;
}
.hero h1 em {
  font-style: normal; color: var(--brand);
  background: linear-gradient(transparent 62%, #DCE7FF 62%);
  padding: 0 2px;
}
.hero__sub { margin-top: 14px; max-width: 62em; font-size: 15px; color: var(--ink-2); }
.hero__sub strong { color: var(--ink); font-weight: 650; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px;
  box-shadow: var(--shadow-sm);
}
.chips li::before { content: "✓"; color: var(--green); font-weight: 700; font-size: 12px; }

/* ---------- layout ---------- */

.studio {
  display: grid;
  grid-template-columns: minmax(0, 396px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 28px;
}

.sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 20px;
}
.card__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.card__num {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12.5px; font-weight: 700; margin-top: 1px;
}
.card__num--violet { background: var(--violet-soft); color: var(--violet); font-size: 12px; }
.card__title { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.card__hint { margin-top: 2px; font-size: 12.5px; color: var(--muted); }

/* ---------- category grid ---------- */

.catgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.catbtn {
  display: flex; align-items: flex-start; gap: 7px; min-width: 0;
  font: inherit; font-size: 12.5px; font-weight: 600; text-align: left;
  color: var(--ink-2); cursor: pointer;
  padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.catbtn:hover { border-color: #C7D6F2; background: #fff; color: var(--ink); }
.catbtn__num {
  flex: none; display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 6px; margin-top: 1px;
  background: #fff; border: 1px solid var(--line);
  font-size: 10px; font-weight: 800; color: var(--brand);
}
.catbtn__name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: normal; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.catbtn.is-on {
  background: var(--brand-soft); border-color: #C3D8FF; color: var(--brand-dark);
}
.catbtn.is-on .catbtn__num { background: var(--brand); border-color: var(--brand); color: #fff; }
.catgrid .fi-note, #catNote { grid-column: 1 / -1; }
#catNote { margin-top: 10px; }

/* ---------- fields ---------- */

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.card > .field { margin-top: 14px; }

.field > label,
.field .label,
label.inline {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12.5px; font-weight: 650; color: var(--ink-2);
}

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  appearance: none; -webkit-appearance: none;
}
input[type="text"], input[type="date"], select { height: 42px; padding-top: 0; padding-bottom: 0; }
select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 4.6 6 8l3.4-3.4' fill='none' stroke='%236B7A90' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px 12px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: #CFD9EA; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}
input::placeholder, textarea::placeholder { color: #A6B2C4; }

.amountrow { display: flex; gap: 8px; align-items: stretch; }
.amountrow input { flex: 1 1 auto; min-width: 0; }
.amountrow__cur {
  flex: none; display: grid; place-items: center; min-width: 62px;
  padding: 0 10px; border-radius: 10px;
  border: 1px dashed #CBD8EE; background: var(--surface-2);
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink-2);
}

#returnField.is-dim { opacity: .55; }

.fi-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.fi-note strong { color: var(--ink-2); font-weight: 650; }

.counter { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.counter > span:first-child {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.counter > span:first-child.is-warn { color: var(--amber); }

/* ---------- samples ---------- */

.samples { margin-top: 13px; }
.samples__row { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.sample {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 6px; text-align: left;
  font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer;
  padding: 8px 9px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.sample:hover { border-color: #C7D6F2; background: #fff; color: var(--ink); }
.sample__num {
  flex: none; display: grid; place-items: center;
  width: 17px; height: 17px; border-radius: 6px;
  background: #fff; border: 1px solid var(--line);
  font-size: 10px; font-weight: 700; color: var(--brand);
}
.sample__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#btnFillSample { margin-top: 12px; }

/* ---------- detect / analysis ---------- */

.detect {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; flex-wrap: wrap;
}
.detect .pill { font-family: var(--mono); letter-spacing: .04em; }

.analysis {
  margin-top: 12px; padding: 11px 12px;
  border: 1px solid #E1EAFB; border-radius: 13px;
  background: linear-gradient(180deg, #F8FBFF, #F2F7FF);
}
.analysis__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.analysis__head strong { font-size: 13px; font-weight: 700; color: var(--ink); }
.analysis .fi-note { margin-top: 3px; }
.analysis.is-urgent { border-color: #F3DEBE; background: linear-gradient(180deg, #FFFBF3, #FEF5E7); }
.kwlist { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.kwlist li {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 7px;
}

#btnCompose { margin-top: 14px; }
#aiNote { margin-top: 8px; }

/* ---------- reply column ---------- */

.reply { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.reply__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.reply__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section__title { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.section__desc { margin-top: 3px; font-size: 13px; color: var(--muted); }

.paper {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px 24px;
  overflow: hidden;
}
.paper::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #3B82F6, #1D4ED8);
}
.paper.is-ai::before { background: linear-gradient(180deg, #8B5CF6, #6D28D9); }
.paper__top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.paper__chip {
  font-size: 11px; font-weight: 700; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px;
}
.paper__label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.paper__subject {
  margin: 3px 0 16px; padding-bottom: 12px;
  font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.4;
  border-bottom: 1px solid var(--line-soft);
  word-break: keep-all;
}
.paper__body {
  white-space: pre-wrap;
  font-size: 14px; line-height: 1.75; color: var(--ink);
  word-break: keep-all; overflow-wrap: break-word;
}
.paper__body .ph {
  background: var(--amber-soft); color: #8A4A08;
  border-radius: 4px; padding: 0 3px;
}
.paper.is-ai .paper__body { font-size: 14.5px; }

.warnbox {
  border: 1px solid #F3DEBE; background: var(--amber-soft);
  border-radius: var(--radius); padding: 11px 14px;
}
.warnbox strong { display: block; font-size: 12.5px; color: #8A4A08; }
.warnbox .fi-note { color: #8A4A08; margin-top: 3px; }

.gloss__body {
  white-space: pre-wrap;
  font-size: 13.5px; line-height: 1.72; color: var(--ink-2);
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
#aiMeta {
  margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.gloss__actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- customs ---------- */

.customsgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.custile {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  font: inherit; text-align: left; cursor: pointer;
  padding: 9px 10px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease;
}
.custile:hover { border-color: #C7D6F2; background: #fff; }
.custile.is-on { border-color: var(--brand); background: var(--brand-soft); }
.custile__top { display: flex; align-items: center; gap: 6px; }
.custile__code {
  flex: none; display: grid; place-items: center;
  width: 22px; height: 18px; border-radius: 5px;
  background: #fff; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 9.5px; font-weight: 800; color: var(--brand);
}
.custile.is-on .custile__code { background: var(--brand); border-color: var(--brand); color: #fff; }
.custile__name {
  min-width: 0; font-size: 12px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.custile__line {
  font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.custile.is-on .custile__line { color: var(--brand-dark); }

.customs__detail {
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.customs__row { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; }
.customs__k {
  flex: none; width: 74px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase;
}
.customs__v { min-width: 0; flex: 1 1 auto; color: var(--ink-2); }

.customs__insert { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.customs__preview {
  margin-top: 11px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
.customs__text {
  margin-top: 4px; white-space: pre-wrap;
  font-size: 12.5px; line-height: 1.7; color: var(--ink-2);
}

/* ---------- history ---------- */

.hist__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hist { display: flex; flex-direction: column; gap: 8px; }
.hist__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.hist__main { min-width: 0; flex: 1 1 auto; }
.hist__title {
  font-size: 12.5px; font-weight: 650; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist__meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 3px; font-size: 11px; color: var(--muted);
}
.hist__meta span { white-space: nowrap; }
.hist__actions { display: flex; gap: 6px; flex: none; }

/* ---------- empty / footer / toast ---------- */

.empty {
  padding: 26px 20px; text-align: center; color: var(--muted); font-size: 13px;
  border: 1px dashed var(--line); border-radius: var(--radius-lg); background: var(--surface-2);
}
.empty strong { display: block; color: var(--ink-2); font-size: 13.5px; margin-bottom: 4px; }

.foot {
  margin: 38px 0 0; padding: 22px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 1.7;
}
.foot p + p { margin-top: 6px; }
.foot strong { color: var(--ink-2); font-weight: 650; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: #0F172A; color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 12px; z-index: 80;
  box-shadow: 0 18px 34px -18px rgba(15, 23, 42, .8);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: min(92vw, 520px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .sidebar > .card:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .customsgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper { padding: 18px 18px 20px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar__actions .pill { display: none; }
  .card { padding: 17px; border-radius: 16px; }
  .topbar__inner { height: 58px; }
  .brand__text small { display: none; }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: 24px; }
  .eyebrow { font-size: 10.5px; letter-spacing: .08em; }
  .hero__sub { font-size: 13.5px; }
  .btn { padding: 8px 12px; font-size: 13px; }
  .brand__mark { width: 30px; height: 30px; border-radius: 10px; }
  .brand__text strong { font-size: 14px; }
  .seg button { padding: 6px 9px; }
  .seg--wide button { flex: 1 1 calc(50% - 4px); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .catgrid { grid-template-columns: minmax(0, 1fr); }
  .catbtn__name { white-space: normal; }
  .reply__head { align-items: flex-start; }
  .reply__actions { gap: 6px; }
  .paper { padding: 16px 16px 18px; border-radius: 16px; }
  .paper__subject { font-size: 15px; }
  .paper__body { font-size: 13.5px; }
  .customsgrid { grid-template-columns: minmax(0, 1fr); }
  .customs__k { width: 66px; }
  .hist__item { align-items: flex-start; flex-direction: column; gap: 8px; }
  .hist__actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 420px) {
  .topbar__actions .btn--ghost { display: none; }
  .samples__row { flex-direction: column; }
  .amountrow__cur { min-width: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
}

@media print {
  .topbar, .toast, .btn, .chips, .samples, .sidebar, .customsgrid, .hist__actions { display: none !important; }
  body { background: #fff; }
  .card, .paper { box-shadow: none; break-inside: avoid; }
}
