/* DuoPick Team v2.1.48
   Final readability/responsive layer. Kept separate from the legacy stylesheet
   so the existing workflow rules remain intact and rollback stays simple. */
@font-face{
  font-family:"DuoPick Pretendard";
  src:url("/static/fonts/Pretendard-Regular.woff2?v=1.3.9") format("woff2");
  font-style:normal;font-weight:400;font-display:swap
}
@font-face{
  font-family:"DuoPick Pretendard";
  src:url("/static/fonts/Pretendard-SemiBold.woff2?v=1.3.9") format("woff2");
  font-style:normal;font-weight:600 900;font-display:swap
}

:root{
  --duopick-ui-font:"DuoPick Pretendard",Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR","Malgun Gothic",sans-serif;
  --ui-bg:#f3f6fa;
  --ui-panel:#fff;
  --ui-panel-soft:#f8fafc;
  --ui-text:#172033;
  --ui-muted:#64748b;
  --ui-line:#d8e0ea;
  --ui-line-strong:#c5d0dd;
  --ui-brand:#4f46c8;
  --ui-brand-dark:#3f37a8;
  --ui-focus:#2563eb;
  --ui-success:#087f5b;
  --ui-danger:#b4233f;
  --ui-radius:14px;
  --ui-topbar:76px;
}

html{font-size:16px;background:var(--ui-bg)}
body,input,textarea,select,button,.button-like,.button-link{font-family:var(--duopick-ui-font)!important}
body{font-size:14px;line-height:1.55;color:var(--ui-text);background:var(--ui-bg)}

/* Clear hierarchy and consistently readable controls */
h1{font-size:clamp(1.55rem,2vw,2.05rem)!important;line-height:1.2!important}
.section-head h2,.card h2{font-size:1.08rem!important;line-height:1.35!important}
.section-head h3,.card h3{font-size:.94rem!important}
.section-head p,.sub,.helper,.muted{font-size:.78rem!important;line-height:1.58!important;color:var(--ui-muted)!important}
.eyebrow,.manager-kicker{font-size:.69rem!important;letter-spacing:.075em!important}
small{font-size:.73rem;line-height:1.45}

button,.button-like,.button-link{
  min-height:40px!important;
  padding:9px 14px!important;
  border-radius:10px!important;
  font-size:.79rem!important;
  font-weight:700!important;
  line-height:1.25!important;
  letter-spacing:-.01em!important;
  white-space:normal;
}
button:focus-visible,.button-like:focus-visible,.button-link:focus-visible,
input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{
  outline:3px solid rgba(37,99,235,.28)!important;
  outline-offset:2px!important;
}
.primary{
  background:linear-gradient(135deg,var(--ui-brand),#625bd8)!important;
  border-color:transparent!important;color:#fff!important;
  box-shadow:0 7px 18px rgba(79,70,200,.2)!important
}
.primary:hover{background:linear-gradient(135deg,var(--ui-brand-dark),#5148c0)!important}
.ghost{background:#fff!important;color:#3d4b61!important;border-color:var(--ui-line)!important}
.ghost:hover{background:#f6f8fb!important;border-color:#aebccb!important;color:#1e293b!important}
.danger,.danger-outline{color:var(--ui-danger)!important;background:#fff5f6!important;border-color:#f1b9c4!important}
.textbtn{font-size:.76rem!important;font-weight:700!important;color:var(--ui-brand)!important;padding:5px 4px!important;min-height:30px!important}
.button-row{gap:8px!important;flex-wrap:wrap}
.button-row>*{flex:0 1 auto}

input,textarea,select{
  min-height:40px;
  padding:9px 11px!important;
  border-color:var(--ui-line)!important;
  border-radius:10px!important;
  background:#fff!important;
  color:var(--ui-text)!important;
  font-size:.81rem!important;
  line-height:1.4!important
}
textarea{min-height:88px}
.form-grid label,.compare label,.source-box label{font-size:.75rem!important;font-weight:650!important;color:#526176!important}

.card{
  padding:clamp(16px,1.5vw,22px)!important;
  border:1px solid var(--ui-line)!important;
  border-radius:var(--ui-radius)!important;
  box-shadow:0 6px 22px rgba(26,40,65,.055)!important
}
.section-head{gap:14px!important;margin-bottom:16px!important}
.section-head>div{min-width:0}

/* Header: stays useful without crushing action labels */
.topbar.clean-topbar{
  min-height:var(--ui-topbar);height:auto!important;
  display:grid!important;
  grid-template-columns:minmax(225px,auto) auto minmax(330px,1fr);
  align-items:center;gap:14px;
  padding:10px clamp(14px,1.8vw,26px)!important;
  background:rgba(255,255,255,.96)!important;
  border-bottom:1px solid var(--ui-line)!important
}
.brand-block{min-width:0!important}
.brand-copy strong{font-size:1.08rem!important}
.brand-copy>span{font-size:.68rem!important;color:#66758a!important}
.main-mode-nav{justify-self:center;display:flex!important;min-width:0}
.main-mode-nav .mode-btn{min-width:92px!important;min-height:40px!important;padding:9px 13px!important;font-size:.77rem!important;white-space:nowrap}
.clean-topbar .top-actions{justify-content:flex-end!important;min-width:0;flex-wrap:wrap!important}
.clean-topbar .editor-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.clean-topbar .top-actions button{white-space:nowrap}
.team-status-btn,.update-top-btn{min-height:40px!important}

/* Main shell */
.app{grid-template-columns:280px minmax(0,1fr)!important;min-height:calc(100vh - var(--ui-topbar))!important}
.sidebar{
  top:var(--ui-topbar)!important;height:calc(100vh - var(--ui-topbar))!important;
  padding:17px 14px 22px!important;background:#f8fafc!important;border-right-color:var(--ui-line)!important
}
.main{width:100%!important;max-width:1920px!important;padding:22px clamp(18px,2.2vw,36px) 44px!important}
.source-box-title b{font-size:.82rem!important}.source-box-title small{font-size:.68rem!important}
.side-title{font-size:.75rem!important;font-weight:750!important;color:#536176!important}
.side-title span{font-size:.68rem!important}
.side-search input{height:40px!important;font-size:.77rem!important}
.product-list{gap:7px!important}
.product-item{padding:12px 48px 12px 11px!important;border-color:#e6ebf1!important;background:#fff!important}
.product-item strong{font-size:.78rem!important;line-height:1.45!important}
.product-item small{font-size:.68rem!important;line-height:1.45!important}
.workflow-mini{max-width:84px;font-size:.63rem!important;padding:4px 7px}
.product-local-delete{min-height:30px!important;font-size:.68rem!important;padding:5px 7px!important}
.settings-btn{min-height:40px!important;font-size:.77rem!important}

/* Dense work areas remain compact, but not tiny */
.workflow-tabs{overflow-x:auto;scrollbar-width:thin}
.workflow-tabs button{min-width:112px!important;min-height:48px!important;font-size:.76rem!important}
.workflow-tabs button span{font-size:.76rem!important}.workflow-tabs button small{font-size:.63rem!important}
.tabs button,.ops-nav-btn{font-size:.77rem!important}
.ops-nav{overflow-x:auto;scrollbar-width:thin}
.ops-nav-btn{white-space:nowrap!important;min-width:max-content}
.ops-kpi span,.ops-kpi small{font-size:.7rem!important}.ops-kpi strong{font-size:1.35rem!important}
.feature-chips span,.decision-pill,.status-chip,.badge{font-size:.68rem!important}
.collector-table,.ops-table,.profit-v2-table,.profit-tax-table{font-size:.75rem!important}
.table-wrap{overflow:auto;max-width:100%;border-radius:11px}
.table-wrap table{min-width:max-content;width:100%}
.table-wrap th{position:sticky;top:0;z-index:2;background:#f4f7fa!important;font-size:.7rem!important}
.table-wrap td{font-size:.75rem!important}

/* OCR controls and bundled-font explanation */
.ocr-font-toolbar{
  display:grid!important;grid-template-columns:minmax(235px,340px) auto minmax(220px,1fr)!important;
  gap:10px!important;align-items:end!important;padding:13px!important;
  border:1px solid #d7e2ed;border-radius:12px;background:#f7fafc
}
.ocr-font-toolbar label{font-size:.74rem!important;font-weight:700!important}
.ocr-font-toolbar select{width:100%!important;margin-top:5px}
.ocr-font-toolbar>span{align-self:center;font-size:.73rem!important;color:#526176!important}
.image-auto-grid{gap:12px!important}
.ocr-review-actions button{min-height:42px!important;font-size:.76rem!important}

/* Full-screen OCR Studio */
.ocr-studio{inset:12px!important;border-radius:16px!important}
.ocr-studio-topbar{
  grid-template-columns:minmax(240px,1fr) auto auto!important;
  min-height:68px!important;padding:10px 14px!important;gap:10px!important
}
.ocr-studio-title strong{font-size:1rem!important}
.ocr-studio-title .muted{font-size:.7rem!important}
.ocr-studio-body{grid-template-columns:235px minmax(420px,1fr) 390px!important}
.ocr-studio-list-head b{font-size:.78rem!important}
.ocr-studio-list-head small{font-size:.66rem!important}
.ocr-studio-image-row{min-height:56px;padding:9px!important}
.ocr-studio-image-info b{font-size:.74rem!important}.ocr-studio-image-info small{font-size:.65rem!important}
.ocr-studio-state .decision-pill,.ocr-studio-grade{font-size:.62rem!important}
.ocr-studio-tool-tabs button{min-height:40px!important;font-size:.7rem!important;padding:7px 5px!important}
.ocr-studio-actionbar button{min-height:42px!important}
.ocr-editor-toolbar button{min-width:40px!important;padding:8px 9px!important}
.ocrStudioPanel[data-panel="box"]>label{
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  width:100%!important;gap:6px!important;color:#334155;font-size:.74rem!important;
  font-weight:800!important;line-height:1.35
}
.ocrStudioPanel[data-panel="box"]>label>textarea{
  display:block!important;width:100%!important;min-width:0!important;margin:0!important;
  box-sizing:border-box!important;resize:vertical;line-height:1.55!important;font-size:.82rem!important
}
#imageAutoOriginalText{
  min-height:72px!important;background:#f4f7fa!important;color:#667085!important;
  border-color:#dce3ec!important
}
#imageAutoTranslatedText{
  min-height:112px!important;background:#fff!important;border-color:#aebbd0!important;
  box-shadow:inset 0 1px 2px rgba(15,23,42,.04)
}
#imageAutoTranslatedText:focus-visible{
  border-color:#5b6fd8!important;box-shadow:0 0 0 3px rgba(91,111,216,.14)!important
}

/* Dialogs never overflow a small screen */
.modal{padding:16px!important}
.modal-card{width:min(920px,calc(100vw - 32px))!important;max-height:calc(100vh - 32px)!important;overflow:auto}
.modal-card .button-row{justify-content:flex-end}

/* Large desktop: use the room without stretching text indefinitely */
@media(min-width:1680px){
  .app{grid-template-columns:300px minmax(0,1fr)!important}
  .main{padding-left:40px!important;padding-right:40px!important}
  .collector-grid,.ops-grid2,.two-col{gap:18px!important}
  .ocr-studio-body{grid-template-columns:260px minmax(560px,1fr) 430px!important}
}

/* Laptop / small desktop */
@media(max-width:1360px){
  .topbar.clean-topbar{grid-template-columns:minmax(210px,auto) auto 1fr;gap:10px;padding-left:14px!important;padding-right:14px!important}
  .brand-copy>span{display:none}
  .main-mode-nav .mode-btn{min-width:80px!important;padding-left:10px!important;padding-right:10px!important}
  .clean-topbar .editor-actions button{padding-left:10px!important;padding-right:10px!important}
  .app{grid-template-columns:245px minmax(0,1fr)!important}
  .main{padding-left:18px!important;padding-right:18px!important}
  .ocr-studio-body{grid-template-columns:205px minmax(380px,1fr) 350px!important}
}

@media(max-width:1120px){
  :root{--ui-topbar:122px}
  .topbar.clean-topbar{grid-template-columns:1fr auto!important;align-content:center}
  .topbar.clean-topbar>.brand-block{order:0!important}
  .main-mode-nav{order:0!important;justify-self:end}
  .clean-topbar .top-actions{order:1!important;grid-column:1/-1;width:100%;justify-content:flex-end!important;border-top:1px solid #edf1f5;padding-top:8px}
  .team-status-btn span{display:inline!important;max-width:130px;overflow:hidden;text-overflow:ellipsis}
  .app{grid-template-columns:225px minmax(0,1fr)!important}
  .sidebar{top:var(--ui-topbar)!important;height:calc(100vh - var(--ui-topbar))!important}
  .ocr-studio{inset:8px!important}
  .ocr-studio-topbar{grid-template-columns:1fr auto!important}
  .ocr-studio-review{grid-column:1/-1;justify-content:flex-end!important}
  .ocr-studio-body{grid-template-columns:190px minmax(0,1fr)!important;grid-template-rows:minmax(390px,1fr) 320px!important;overflow:auto}
  .ocr-studio-tools{grid-column:1/-1;display:grid!important;grid-template-columns:160px minmax(0,1fr) 220px;border-left:0!important;border-top:1px solid var(--ui-line)}
  .ocr-studio-tool-tabs{grid-template-columns:1fr!important;align-content:start;border-right:1px solid var(--ui-line);border-bottom:0!important}
  .ocr-studio-tool-scroll{max-height:320px}.ocr-studio-actionbar{justify-content:center}
}

/* Tablet portrait and compact browser windows */
@media(max-width:880px){
  :root{--ui-topbar:auto}
  .topbar.clean-topbar{position:relative!important;grid-template-columns:1fr!important;padding:10px 12px!important;gap:9px!important}
  .brand-block{justify-content:center}.brand-copy>span{display:block}
  .main-mode-nav{justify-self:stretch;width:100%}.main-mode-nav .mode-btn{flex:1;min-width:0!important}
  .clean-topbar .top-actions{grid-column:auto;justify-content:center!important;padding-top:9px}
  .clean-topbar .editor-actions{justify-content:center!important}
  .app{display:block!important;min-height:0!important}
  .sidebar{position:relative!important;top:0!important;width:100%!important;height:auto!important;padding:13px!important;border-right:0!important;border-bottom:1px solid var(--ui-line)!important}
  .integrated-source-box{margin-bottom:10px!important}
  .legacy-import{display:none}
  .product-list{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(210px,270px);overflow-x:auto;padding:2px 1px 8px;scroll-snap-type:x proximity}
  .product-item{scroll-snap-align:start;min-height:72px}
  .settings-btn,.product-trash-open{width:auto!important;margin-right:7px!important}
  .main{padding:14px!important}
  .card{margin-bottom:12px!important}
  .section-head{flex-direction:column;align-items:stretch!important}
  .section-head>.button-row{width:100%}
  .section-head>.button-row>*{flex:1 1 160px}
  .ocr-font-toolbar{grid-template-columns:1fr auto!important;align-items:end!important}
  .ocr-font-toolbar>span{grid-column:1/-1}
  .form-grid.three,.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .span2{grid-column:1/-1!important}
  .modal{padding:8px!important}.modal-card{width:calc(100vw - 16px)!important;max-height:calc(100vh - 16px)!important}
  .ocr-studio{inset:0!important;border-radius:0!important}
  .ocr-studio-topbar{grid-template-columns:1fr!important;padding:9px!important}
  .ocr-studio-nav,.ocr-studio-review{grid-column:auto;justify-content:flex-start!important}
  .ocr-studio-body{grid-template-columns:1fr!important;grid-template-rows:128px minmax(420px,1fr) auto!important}
  .ocr-studio-list-panel{border-right:0!important;border-bottom:1px solid var(--ui-line)}
  .ocr-studio-image-list{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(180px,220px);overflow-x:auto;overflow-y:hidden}
  .ocr-studio-tools{grid-column:auto;display:flex!important;min-height:360px}
  .ocr-studio-tool-tabs{grid-template-columns:repeat(4,1fr)!important;border-right:0;border-bottom:1px solid var(--ui-line)!important}
  .ocr-studio-tool-scroll{max-height:none}.ocr-studio-actionbar{display:flex!important}
}

/* Phone / narrow tablet */
@media(max-width:640px){
  body{font-size:13px}
  .brand-block{justify-content:flex-start}.brand-copy>span{font-size:.62rem!important}
  .clean-topbar .top-actions{justify-content:stretch!important}
  .clean-topbar .top-actions>.update-top-btn,.clean-topbar .top-actions>.team-status-btn{flex:1 1 145px}
  .update-top-btn b{display:inline!important}
  .team-status-btn span{display:inline!important;max-width:none}
  .clean-topbar .editor-actions{display:none!important}
  .main{padding:10px!important}
  .card{padding:14px!important;border-radius:12px!important}
  button,.button-like,.button-link{min-height:44px!important;font-size:.78rem!important}
  .main-mode-nav .mode-btn,.update-top-btn,.team-status-btn,.settings-btn{min-height:44px!important}
  input,textarea,select{min-height:44px;font-size:.82rem!important}
  .button-row{width:100%}.button-row>*{flex:1 1 135px}
  .workflow-tabs button{min-width:105px!important}
  .form-grid.three,.form-grid.two,.compare,.collector-grid{grid-template-columns:1fr!important}
  .span2{grid-column:auto!important}
  .ocr-font-toolbar{grid-template-columns:1fr!important}.ocr-font-toolbar>span{grid-column:auto}
  .ocr-font-toolbar button{width:100%}
  .ocr-studio-title{flex-wrap:wrap}.ocr-studio-title .muted{width:100%}
  .ocr-studio-nav button,.ocr-studio-review button{flex:1 1 120px}
  .ocr-studio-workspace{padding:7px!important;min-height:390px!important}
  .ocr-studio-tool-tabs button{font-size:.66rem!important;padding:7px 2px!important;min-height:42px!important}
  .ocr-studio-actionbar>.button-row{grid-template-columns:1fr!important}
}

/* Short laptop screens: fit more without returning to unreadably small text. */
@media(min-width:881px) and (max-height:800px){
  :root{--ui-topbar:68px}
  .topbar.clean-topbar{padding-top:6px!important;padding-bottom:6px!important}
  .sidebar{padding-top:12px!important}.main{padding-top:14px!important}
  .card{padding-top:16px!important;padding-bottom:16px!important;margin-bottom:12px!important}
  .workflow-tabs{margin-bottom:10px!important}
}

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