.koch-panel{
  align-self:start;
  display:grid;
  grid-template-rows:auto;
  gap:14px;
  padding:16px;
  min-height:0;
}
.koch-panel.has-ios-audio-note{
  grid-template-rows:auto;
}
.koch-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
}
.koch-head h1{
  margin:0;
  font-size:clamp(2.4rem,7vw,4.6rem);
  line-height:.86;
  letter-spacing:-.07em;
}
.koch-score{
  min-width:138px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#081527;
}
.koch-score-button{
  width:auto;
  text-align:left;
  cursor:pointer;
  color:var(--ink);
}
.koch-score-button:hover{
  border-color:var(--cyan);
}
.koch-score span{
  display:block;
  color:var(--muted);
  font-size:.72rem;
}
.koch-score strong{
  display:block;
  color:var(--amber);
  font-size:1.65rem;
  line-height:1;
}
.results-wrap{
  display:grid;
  gap:10px;
}
.results-wrap[hidden]{
  display:none;
}
.result-score{
  display:none;
}
.koch-account-panel{
  display:grid;
  align-content:start;
  gap:10px;
}
.koch-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  align-items:start;
}
.koch-stats div,.koch-guest-note,.koch-audio-note{
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#081527;
}
.koch-stats span{
  display:block;
  color:var(--muted);
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.koch-stats strong{
  display:block;
  color:var(--cyan);
  font-size:1.18rem;
  line-height:1.15;
}
.koch-stats button{
  min-width:132px;
  min-height:52px;
  height:100%;
}
.koch-stats button.confirm-step{
  background:var(--amber);
  border-color:var(--amber);
  color:#06101f;
}
.koch-stats button.confirm-final{
  background:var(--red);
  border-color:var(--red);
  color:#06101f;
}
.koch-promotion{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#071728;
}
.koch-promotion span{
  display:block;
  color:var(--cyan);
  font-size:.78rem;
  font-weight:900;
}
.koch-promotion small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  line-height:1.35;
}
.koch-promotion.ready{
  border-color:#59d38c;
  background:#062318;
}
.warn{
  color:var(--amber);
}
.koch-promotion.ready span{
  color:#7df0a8;
}
.koch-promotion button{
  width:auto;
  min-width:150px;
  min-height:38px;
}
.koch-guest-note,.koch-audio-note{
  color:var(--muted);
}
.koch-audio-note{
  font-size:.76rem;
  line-height:1.35;
}
.koch-audio-note[hidden]{
  display:none;
}
.koch-guest-note a{
  color:var(--amber);
  font-weight:900;
}
.koch-session-panel{
  display:grid;
  justify-items:start;
  gap:10px;
}
.koch-session-active,.koch-session-free{
  justify-self:stretch;
}
.koch-session-create,.koch-session-active,.koch-session-free{
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#071728;
}
.koch-session-active{
  border-color:#4bd6c4;
  background:linear-gradient(135deg,#092d2f 0%,#071728 62%);
  box-shadow:0 0 0 1px rgba(120,242,255,.12) inset,0 12px 32px rgba(0,0,0,.22);
}
.koch-session-free{
  border-color:#315f84;
  background:linear-gradient(135deg,#082238 0%,#071728 68%);
}
.koch-session-toggle{
  width:auto;
  min-width:240px;
  min-height:34px;
  padding:8px 11px;
}
.koch-session-create{
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:end;
}
.koch-session-create.is-closed,.koch-session-create[hidden],.koch-session-active[hidden],.koch-session-free[hidden]{
  display:none;
}
.koch-session-create > div:first-child{
  grid-column:1/-1;
}
.koch-session-copy-main{
  grid-column:1/-1;
  justify-self:start;
}
.koch-session-create label{
  display:grid;
  gap:5px;
}
.koch-session-create small,.koch-session-active small,.koch-session-free small{
  display:block;
  color:var(--muted);
  line-height:1.35;
}
.koch-session-active,.koch-session-free{
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
}
.koch-session-active-info{
  min-width:0;
  width:100%;
}
.koch-session-active strong{
  display:block;
  color:var(--cyan);
  font-size:1.1rem;
}
.koch-session-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.koch-session-actions button,.koch-session-create button{
  width:auto;
  min-width:130px;
  min-height:38px;
}
.koch-inline-check{
  width:auto;
  min-height:38px;
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--muted);
  font-size:.75rem;
}
.koch-inline-check input{
  width:auto;
}
.koch-session-score{
  min-height:38px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#081527;
}
.koch-session-score span{
  display:block;
  color:var(--muted);
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.koch-session-score strong{
  color:var(--amber);
  font-size:1.2rem;
}
.koch-session-create button[type="submit"]{
  grid-column:auto;
}
.koch-body{
  min-height:0;
  display:grid;
  grid-template-columns:minmax(210px,280px) minmax(0,1fr);
  gap:14px;
}
.koch-controls{
  display:grid;
  align-content:start;
  gap:10px;
}
.koch-controls label{
  display:grid;
  gap:5px;
}
.farnsworth-settings{
  display:grid;
  gap:8px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#071728;
}
.farnsworth-settings[hidden]{
  display:none;
}
.koch-help{
  margin:0;
  color:var(--muted);
  font-size:.76rem;
  line-height:1.35;
}
.copy-panel{
  min-height:0;
  display:grid;
  grid-template-rows:auto auto auto;
  gap:10px;
}
.copy-panel textarea{
  min-height:190px;
  height:clamp(240px,34dvh,420px);
  text-transform:uppercase;
  font-size:clamp(1.2rem,3vw,2.3rem);
  line-height:1.35;
  border-color:#315879;
  background:#050f1e;
  color:var(--amber);
}
.prompt{
  min-height:38px;
  display:flex;
  align-items:center;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#081527;
  color:var(--muted);
}
.progress{
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:#081527;
  border:1px solid var(--line);
}
.progress span{
  display:block;
  height:100%;
  width:0;
  background:linear-gradient(90deg,var(--blue),var(--cyan));
  transition:width .2s ease;
}
.koch-actions{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  align-items:start;
}
.koch-actions button{
  min-height:38px;
  padding:8px 11px;
  height:auto;
}
button.needs-check{
  animation:checkPulse 1s ease-in-out infinite;
  border-color:var(--amber);
  box-shadow:0 0 0 0 rgba(255,212,121,.45);
}
@keyframes checkPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(255,212,121,.3);filter:none}
  50%{box-shadow:0 0 0 6px rgba(255,212,121,.12);filter:brightness(1.18)}
}
.touch-copy{
  display:grid;
  gap:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#081527;
}
.touch-copy:has(.touch-grid:empty){
  display:none;
}
.touch-copy-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--muted);
  font-size:.76rem;
}
.touch-copy-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
}
.touch-copy-actions button{
  width:auto;
  min-width:100px;
  min-height:34px;
  padding:7px 10px;
}
.touch-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(var(--touch-key-min,52px),1fr));
  gap:8px;
}
.touch-grid[data-size="compact"]{--touch-key-min:46px;--touch-key-height:48px;--touch-key-font:2.15rem}
.touch-grid[data-size="normal"]{--touch-key-min:58px;--touch-key-height:60px;--touch-key-font:2.75rem}
.touch-grid[data-size="large"]{--touch-key-min:72px;--touch-key-height:74px;--touch-key-font:3.45rem}
.touch-grid button{
  appearance:none;
  -webkit-appearance:none;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:var(--touch-key-height,60px);
  min-height:var(--touch-key-height,60px);
  padding:0 !important;
  margin:0;
  background:#10233c;
  color:var(--amber);
  border-color:#315879;
  font-size:var(--touch-key-font,1.18rem);
  line-height:.82;
  font-weight:900;
  font-family:Arial,Helvetica,sans-serif;
  letter-spacing:-.06em;
  text-align:center;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.touch-grid button.current{
  background:var(--amber);
  border-color:var(--amber);
  color:#06101f;
}
.results{
  max-height:220px;
  overflow:auto;
  white-space:pre-wrap;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#050f1e;
  color:var(--muted);
}
.koch-modal{
  position:fixed;
  inset:0;
  z-index:20;
  display:grid;
  place-items:center;
  padding:18px;
  background:#02070ecc;
}
.koch-modal[hidden]{
  display:none;
}
.koch-modal-panel{
  box-sizing:border-box;
  min-width:0;
  width:min(760px,calc(100dvw - 36px));
  max-width:calc(100dvw - 36px);
  max-height:min(84dvh,720px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:12px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#0d1d34;
  box-shadow:0 24px 90px #000a;
  overflow:hidden;
}
.koch-session-modal-panel{
  width:min(980px,calc(100dvw - 36px));
  max-width:calc(100dvw - 36px);
  min-height:calc(100dvh - 36px);
  max-height:calc(100dvh - 36px);
}
.koch-session-modal-body{
  min-height:0;
  min-width:0;
  display:grid;
  gap:14px;
  align-content:start;
  grid-auto-rows:max-content;
  overflow-y:auto;
  overflow-x:hidden;
}
.koch-session-saved{
  min-width:0;
  display:grid;
  gap:9px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#071728;
  align-self:start;
}
.koch-session-list{
  min-width:0;
  display:grid;
  gap:8px;
}
.koch-session-list-item{
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:7px 12px;
  align-items:center;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#081527;
}
.koch-session-list-item.active{
  border-color:var(--cyan);
}
.koch-session-list-item strong,.koch-session-list-item small{
  display:block;
  min-width:0;
  overflow-wrap:anywhere;
}
.koch-session-list-item strong,.koch-session-list-item small,.koch-session-progress{
  grid-column:1;
}
.koch-session-list-item small{
  color:var(--muted);
  margin-top:3px;
}
.koch-session-list-actions{
  min-width:0;
  grid-column:2;
  grid-row:1/4;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:7px;
  align-items:center;
}
.koch-session-list-actions button{
  width:auto;
  min-width:78px;
  min-height:34px;
  padding:7px 10px;
}
.koch-session-list-actions .danger{
  border-color:#7d3a45;
  color:#ffc0c8;
}
.koch-session-modal-body .koch-session-create{
  min-width:0;
  align-self:start;
}
.active-progress{
  margin-top:7px;
  width:100%;
  max-width:none;
  padding-bottom:14px;
  font-size:.84rem;
}
.active-progress::before{
  height:10px;
}
.active-progress i{
  height:8px;
}
.koch-session-progress{
  position:relative;
  display:block;
  padding-bottom:9px;
  color:var(--muted);
  font-size:.78rem;
}
.koch-session-progress::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:5px;
  border-radius:99px;
  background:#0b2539;
  border:1px solid var(--line);
}
.koch-session-progress i{
  position:absolute;
  left:1px;
  bottom:1px;
  display:block;
  height:3px;
  max-width:100%;
  border-radius:99px;
  background:linear-gradient(90deg,var(--cyan),var(--amber));
}
.koch-panel.session-mode{
  border-color:#4bc3d7;
  box-shadow:0 0 0 1px rgba(120,242,255,.16),0 22px 70px #0006;
}
.koch-panel.session-mode [data-session-locked]{
  border-color:#5bbbd6;
  box-shadow:0 0 0 1px rgba(120,242,255,.12) inset;
}
.koch-panel.session-mode [data-reset-settings]{
  display:none;
}
.koch-modal-head{
  min-width:0;
  display:flex;
  align-items:start;
  justify-content:space-between;
  gap:12px;
}
.koch-modal-head h2{
  min-width:0;
  margin:0;
  color:var(--amber);
  font-size:clamp(2rem,5vw,3.6rem);
  line-height:1;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.koch-modal-head button{
  width:auto;
  min-width:110px;
}
.modal-results{
  max-height:none;
}
@media(max-width:820px){
  .koch-modal{padding:8px}
  .koch-modal-panel{
    width:calc(100dvw - 16px);
    max-width:calc(100dvw - 16px);
    padding:12px;
  }
  .koch-session-modal-panel{
    min-height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }
  .koch-modal-head{display:grid;grid-template-columns:1fr}
  .koch-modal-head button{width:100%;min-width:0}
  .koch-modal-head h2{font-size:clamp(1.8rem,9vw,2.35rem)}
  .koch-panel{min-height:auto}
  .koch-head{align-items:start;display:grid}
  .koch-head .koch-score{display:none}
  .result-score{display:block}
  .koch-stats{grid-template-columns:1fr 1fr}
  .koch-stats button{grid-column:1/-1}
  .koch-promotion{align-items:stretch;display:grid}
  .koch-promotion button{width:100%}
  .koch-session-create,.koch-session-active{grid-template-columns:1fr}
  .koch-session-actions{display:grid;justify-content:stretch}
  .koch-session-actions button,.koch-session-create button{width:100%}
  .koch-session-list-item{grid-template-columns:1fr}
  .koch-session-list-actions{grid-column:1;grid-row:auto;display:grid;grid-template-columns:1fr 1fr}
  .koch-session-list-actions button{width:100%;min-width:0}
  .koch-body{grid-template-columns:1fr}
  .koch-actions{grid-template-columns:1fr 1fr}
  .koch-actions button:first-child{grid-column:1/-1}
  .copy-panel{grid-template-rows:auto minmax(180px,36dvh) auto}
  .touch-copy-head{align-items:stretch;display:grid}
  .touch-copy-actions{display:grid;grid-template-columns:1fr 1fr}
  .touch-copy-actions button{width:100%;min-width:0}
}
