
/* MediTalk 22.0 — communication first */
:root{--bg:#f3f6f8;--ink:#203641;--muted:#596c76;--line:#dce5e9;--green:#147e76;--blue:#206b9a;--shadow:0 3px 14px rgba(28,53,68,.05)}
body{background:var(--bg);font-family:"Pretendard","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif;line-height:1.45}
.app{display:block;max-width:1680px;margin:auto}
.app>header{background:#fff;color:var(--ink);padding:16px 28px;border-bottom:1px solid var(--line);gap:24px;min-height:92px;align-items:center}
.brand-area{display:flex;flex-wrap:wrap;align-items:center;gap:18px}
.brand-square{display:flex;width:auto;height:auto;min-width:0;min-height:0;padding:0;background:transparent;box-shadow:none;border:0;border-radius:0;gap:10px;align-items:center}
.brand-square .brand-logo{width:58px;height:58px;max-height:58px;padding:0;object-fit:contain;border-radius:12px;clip-path:none;transform:none}
.brand-square .brand-name{font-size:24px;color:#173b45;line-height:1.2;margin:0}
.brand-caption{font-size:12px;color:var(--muted);font-weight:500;margin-top:4px;letter-spacing:.04em}
.app-version{font-size:11px!important;color:#596c76!important;background:#f0f5f7;padding:4px 8px;border-radius:6px;grid-column:auto;margin:0!important}
.quick-categories{display:flex;width:auto;gap:6px}
.quick-category{display:flex;min-width:72px;min-height:44px;height:44px;width:auto;padding:8px 11px;border:1px solid var(--line);border-radius:9px;gap:5px}
.quick-category img{width:22px;height:22px}
.quick-category span{font-size:13px;font-weight:700;white-space:nowrap}
.quick-category.active{background:#e7f5f1;border-color:#147e76}
.voice-settings{position:relative;margin-left:auto;flex-shrink:0}
.voice-settings>summary,.composer-options>summary{cursor:pointer;list-style:none;min-height:44px;display:flex;align-items:center;gap:10px;font-size:14px;font-weight:700;color:#405965}
.voice-settings>summary{padding:10px 15px;border:1px solid var(--line);border-radius:10px;background:white}
.voice-settings>summary:after,.composer-options>summary:after{content:"＋";margin-left:auto}
.voice-settings[open]>summary:after,.composer-options[open]>summary:after{content:"−"}
.voice-settings .voice-row{position:absolute;z-index:30;right:0;top:54px;width:410px;max-width:calc(100vw - 32px);padding:20px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 14px 45px #173b4526}
.voice-control{color:var(--ink);min-width:0}
.voice-row select{width:100%;min-width:0}
.voice-quality-status{background:#f0f5f7;color:#38535f;font-size:12px}
.instant-panel{margin:22px 28px 20px}
.instant-heading{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:11px;gap:10px}
.instant-heading h2{font-size:17px;margin:0;font-weight:800}
.instant-heading p{font-size:13px;color:var(--muted);margin:0}
.instant-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.instant-button{display:flex;align-items:center;justify-content:center;gap:12px;min-height:88px;padding:14px 12px;background:white;color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);font-size:20px;line-height:1.3}
.instant-button svg{width:30px;height:30px;flex-shrink:0}
.instant-button.help{background:#147e76;border-color:#147e76;color:white}
.instant-button.refuse{background:#fff4f2;border-color:#ebc7c1;color:#963e35}
.instant-button.pain{background:#fff8e9;border-color:#ead6a7;color:#765414}
.instant-button[aria-pressed="true"]{outline:3px solid #1d5266;outline-offset:3px}
.instant-status{font-size:13px;color:var(--muted);min-height:20px;margin:9px 0 0}
.workspace{display:grid;grid-template-columns:350px minmax(0,1fr);gap:20px;padding:0 28px 28px;align-items:start}
.workspace>.sentence{position:sticky;top:16px;display:flex;flex-direction:column;gap:16px;padding:22px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);min-width:0}
.builder-heading{display:block}
.builder-heading h2{font-size:21px;letter-spacing:-.04em}
.builder-heading p{font-size:13px;font-weight:400;line-height:1.6;margin-top:6px}
.sentence-actions{display:grid;grid-template-columns:1fr 1fr;margin-top:15px;gap:8px}
button{border-radius:10px;box-shadow:none;transition:background-color .15s,border-color .15s;touch-action:manipulation}
button:disabled{opacity:.45;cursor:not-allowed}
.speak{background:#147e76}
.clear{background:#f3f5f7;color:#52636d;border:1px solid var(--line)}
.sentence-steps{display:grid;grid-template-columns:1fr;gap:8px}
.sentence-step{min-height:69px;border:1px solid var(--line);border-radius:11px;padding:10px 12px;grid-template-columns:28px 1fr;gap:3px 8px}
.sentence-step .step-number{width:25px;height:25px;background:#eaf0f3;color:#52636d;font-size:12px;grid-row:1/3}
.sentence-step .step-name{font-size:12px;color:var(--muted)}
.sentence-step strong{grid-column:2;text-align:left;font-size:17px;line-height:1.3}
.sentence-step.active{background:#edf8f5;border-color:#147e76;box-shadow:inset 3px 0 #147e76}
.sentence-step.active .step-number{background:#147e76;color:white}
.sentence-box{border:1px dashed #c8d5dc;border-radius:10px;min-height:52px;padding:10px;font-size:16px;gap:6px}
.placeholder{font-size:13px;color:var(--muted);line-height:1.6}
.sentence-box .sentence-chip{border:1px solid #dae4e9;border-radius:7px;font-size:15px;padding:4px 6px}
.sentence-box .sentence-chip button{min-height:28px;min-width:28px;background:#eef2f5;color:#5c6e78}
.sentence-preview,.sentence-preview.incomplete{background:#edf8f5;border:1px solid #c7e3db;border-radius:12px;padding:15px;gap:8px}
.sentence-preview span{color:#316b60;font-size:12px}
.sentence-preview strong{font-size:24px;line-height:1.55;word-break:keep-all;overflow-wrap:anywhere}
.sentence-preview.incomplete strong{color:#60776f;font-size:17px;font-weight:500}
.composer-options{border-top:1px solid var(--line);padding-top:4px}
.sentence-presets{gap:6px;margin:8px 0 12px}
.sentence-presets button,.choice-row button{min-height:44px;border:1px solid var(--line);padding:7px 10px;border-radius:8px;font-size:14px;font-weight:600;background:#f6f9fa;color:#314f5c}
.choice-row{padding:8px 0;border:0;gap:6px}
.choice-row>span{width:100%;font-size:12px;color:var(--muted);margin:0 0 2px}
.workspace>main{display:block;min-width:0;background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow)}
#categories{display:flex;gap:6px;padding:12px;background:#fff;border:0;border-bottom:1px solid var(--line);overflow-x:auto}
#categories .category{display:flex;align-items:center;justify-content:center;width:auto;flex:1;min-width:96px;height:57px;padding:8px;margin:0;gap:8px;border:1px solid transparent;border-radius:10px}
.category-icon{width:35px;height:35px;max-height:35px;flex-shrink:0}
.category-label{font-size:16px;min-height:0;width:auto;font-weight:700;white-space:nowrap}
.category.active{background:#eaf6f3;border-color:#b4d8cf!important;color:#116b61}
.tools{grid-template-columns:minmax(100px,1fr) auto auto;padding:14px 16px;background:#fff;gap:8px}
.tools input{background:#f5f8fa;border-color:#e2e9ed;min-width:0;font-size:15px}
.tools button{font-size:13px;min-height:44px;padding:10px 12px}
.backspace,.add{background:#f3f7f9;color:#345362;border:1px solid var(--line)}
.board{grid-template-columns:repeat(auto-fill,minmax(126px,1fr));gap:12px;padding:16px;overflow:visible;background:#f8fafb}
.tile{min-height:146px;border:1px solid #dce5e9!important;border-radius:13px;padding:10px;box-shadow:0 2px 5px #20364106;grid-template-rows:minmax(75px,1fr) auto;gap:8px;aspect-ratio:1/1.05}
.tile:hover{border-color:#6da99d!important;background:#f2faf7}
.tile:focus-visible{outline:3px solid #197c72;outline-offset:2px}
.tile .label{font-size:18px;font-weight:700;line-height:1.35;min-height:1.5em}
.section-title{font-size:15px;margin:6px 0 0;color:#536b76}
.smart-note{font-size:15px;border-radius:12px}
dialog{border-radius:16px}
button:focus-visible,summary:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #166e94;outline-offset:3px}
@media(max-width:1100px){.brand-area{gap:10px}.app-version{display:none}.workspace{grid-template-columns:300px minmax(0,1fr);gap:14px}.instant-button{font-size:17px;gap:8px}.instant-button svg{width:25px}.quick-category{min-width:0}.workspace>.sentence{padding:16px}.category-icon{display:none}.instant-grid{gap:8px}}
@media(max-width:800px){.app>header{padding:12px 16px;gap:10px;flex-wrap:wrap}.brand-area{flex:1}.brand-square .brand-logo{width:42px;height:42px}.brand-square .brand-name{font-size:20px}.brand-caption{display:none}.quick-categories{order:3}.quick-category img{display:none}.quick-category span{font-size:12px}.voice-settings>summary{padding:8px 10px;font-size:12px}.instant-panel{margin:18px 16px 14px}.instant-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.instant-button{min-height:72px;font-size:17px}.instant-heading p{font-size:11px}.workspace{display:flex;flex-direction:column;padding:0 16px 20px;gap:14px}.workspace>.sentence{position:static;width:100%;gap:12px}.workspace>main{width:100%}.builder-heading{display:flex;gap:10px;align-items:center}.builder-heading h2{font-size:18px}.builder-heading p{max-width:190px;font-size:12px}.sentence-actions{margin:0;flex-shrink:0}.sentence-actions button{padding:10px;font-size:13px}.sentence-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.sentence-step{padding:8px;grid-template-columns:1fr;gap:4px;min-height:90px}.sentence-step .step-number{display:none}.sentence-step strong{grid-column:1;font-size:14px}.sentence-step .step-name{font-size:11px}.sentence-preview strong{font-size:22px}.sentence-box:has(.placeholder){display:none}.board{grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:9px;padding:12px}.tile{min-height:128px}.tile .label{font-size:16px}.tools{grid-template-columns:minmax(0,1fr) auto auto;padding:10px;gap:5px}.tools button{padding:8px;font-size:12px}#categories .category{min-width:76px;height:48px}.category-label{font-size:14px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* Keep legacy icon sizing from changing the new navigation layout. */
.app>header .brand-area{align-items:center;align-self:center}
.app>header .brand-square{aspect-ratio:auto!important;width:auto!important;height:auto!important;min-height:0!important;align-self:center}
.app>header .app-version{align-self:center!important;justify-self:auto}
.app>header .quick-category{flex:0 0 auto!important;width:auto!important;min-width:max-content;padding:8px 12px!important}
.app>header .quick-categories{width:auto!important;flex-wrap:wrap}
#categories .category-icon{width:34px!important;height:34px!important;max-height:34px!important;min-width:34px!important;object-fit:contain!important;clip-path:none!important;transform:none!important}
#categories .category-label{position:static!important;width:auto!important;min-width:max-content;flex:0 0 auto;font-size:16px!important;line-height:1.3!important}
@media(max-width:1100px){#categories .category-icon{display:none!important}}
@media(max-width:800px){.brand-area{flex-wrap:wrap}.brand-square{flex:1}.app>header .quick-categories{flex-basis:100%;order:3}.app>header .quick-category{padding:6px 10px!important}.app>header{align-items:flex-start}.voice-settings{margin-top:2px}#categories .category-label{font-size:14px!important}}

.app>header .quick-category{aspect-ratio:auto!important;width:110px!important;min-width:110px!important;justify-content:center}.app>header .quick-category img{flex:0 0 22px}.app>header .quick-category span{flex:0 0 auto}
@media(max-width:800px){.app>header .quick-category{width:94px!important;min-width:94px!important}}

/* v22.0.1: full-size category pictograms with the name inside each icon. */
#categories{gap:10px;padding:12px;align-items:center;overflow-x:auto}
#categories .category{display:block!important;flex:1 0 160px!important;width:160px!important;min-width:160px!important;height:178px!important;padding:3px!important;border:2px solid #dce5e9;border-radius:13px}
#categories .category-icon{display:block!important;width:100%!important;min-width:0!important;height:168px!important;max-height:168px!important;max-width:100%!important;transform:none!important;clip-path:none!important}
#categories .category-label{display:none!important}
#categories .category.active{border-color:#147e76!important;background:#edf8f5}
@media(max-width:800px){#categories .category{flex:0 0 160px!important}#categories .category-icon{display:block!important}}

/* v22.0.2: reserve independent picture/text rows on portrait screens. */
@media(max-width:800px){
  .board .tile,.recommend-list .tile{
    aspect-ratio:auto!important;height:auto!important;min-height:170px!important;
    grid-template-rows:100px minmax(42px,auto)!important;
    gap:8px!important;padding:10px!important;align-content:start!important;
    overflow:hidden;isolation:isolate;
  }
  .board .tile .icon-window,.recommend-list .tile .icon-window{
    grid-row:1;min-height:0!important;height:100px!important;max-height:100px!important;
    width:100%;min-width:0;overflow:hidden!important;contain:paint;
  }
  .board .tile .icon-window .icon,.recommend-list .tile .icon-window .icon{
    transform:none!important;clip-path:none!important;height:100%!important;
    width:100%!important;max-height:100%!important;object-fit:contain!important;
  }
  .board .tile>.label,.recommend-list .recommend-word{
    position:relative!important;z-index:1;grid-row:2;
    min-height:42px!important;height:auto!important;max-height:none!important;
    font-size:16px!important;line-height:1.35!important;white-space:normal!important;
    overflow:visible!important;word-break:keep-all;overflow-wrap:anywhere;
    align-self:stretch;background:#fff;padding:0 2px!important;
  }
  .recommend-list .tile{grid-template-rows:100px minmax(42px,auto) auto!important}
  .recommend-list .recommend-sentence{grid-row:3;line-height:1.4}
  .board .tile>.symbol{grid-row:1;max-height:100px;overflow:hidden;align-self:center}
  .instant-button{flex-direction:column;gap:6px;min-height:94px;padding:10px 5px;font-size:16px;word-break:keep-all}
  .instant-button>span{max-width:100%;overflow-wrap:anywhere}
}
