.taehak-helper {
  position: fixed;
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  inset-block-end: max(1rem, env(safe-area-inset-bottom));
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .65rem;
  max-width: calc(100% - 2rem);
  color: var(--peak-ink, #eeeae0);
  font: .9rem/1.6 var(--peak-sans, system-ui, sans-serif);
  text-align: start;
  word-break: keep-all;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.taehak-helper-panel, .taehak-helper-launch { pointer-events: auto; }
.taehak-helper, .taehak-helper * { box-sizing: border-box; }
.taehak-helper [hidden] { display: none !important; }
.taehak-helper :is(button, textarea) { font: inherit; }
.taehak-helper :is(button, a, textarea):focus-visible { outline: 2px solid var(--peak-accent, #e5ba79); outline-offset: 3px; }
.taehak-helper button { cursor: pointer; }
.taehak-helper button:disabled { cursor: wait; opacity: .7; }
.taehak-helper .taehak-helper-launch {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex: none;
  min-height: 3.5rem;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--peak-ink, #eeeae0);
}
.taehak-helper-bubble {
  position: relative;
  padding: .48rem .8rem;
  border: 1px solid var(--peak-line, #3c4940);
  border-radius: .55rem;
  background: var(--peak-panel, #1c2520);
  box-shadow: 0 .2rem .6rem #080c0a55;
  font-weight: 650;
  font-size: .8rem;
  white-space: nowrap;
}
.taehak-helper-bubble::after {
  content: "";
  position: absolute;
  inset-inline-end: -.3rem;
  top: calc(50% - .3rem);
  width: .55rem;
  height: .55rem;
  border-top: 1px solid var(--peak-line, #3c4940);
  border-right: 1px solid var(--peak-line, #3c4940);
  background: var(--peak-panel, #1c2520);
  transform: rotate(45deg);
}
.taehak-helper-logo {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  flex: none;
  border: 1px solid var(--peak-action, #d9b478);
  border-radius: 50%;
  background: var(--peak-paper, #131915);
  box-shadow: 0 .25rem .8rem #080c0a80;
}
.taehak-helper-logo img { display: block; width: 3rem; height: 3rem; object-fit: contain; border-radius: 50%; }
.taehak-helper-launch:hover .taehak-helper-logo { border-color: var(--peak-green, #e3eade); }
.taehak-helper-launch[aria-expanded="true"] .taehak-helper-bubble { display: none; }
.taehak-helper-panel {
  --peak-paper: #182539;
  --peak-panel: #293a54;
  --peak-field: #121d2e;
  --peak-selected: #334b6c;
  --peak-line: #587197;
  --peak-ink: #eef4ff;
  --peak-green: #f6f8ff;
  --peak-muted: #bdcde5;
  --peak-action: #b8d0fc;
  --peak-action-ink: #15243a;
  --peak-accent: #d2e3ff;
  display: flex;
  flex-direction: column;
  width: 22.5rem;
  max-width: 100%;
  height: min(33rem, calc(100vh - 6.5rem - env(safe-area-inset-bottom)));
  height: min(33rem, calc(100dvh - 6.5rem - env(safe-area-inset-bottom)));
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid #7891bb;
  border-radius: 1rem;
  background: var(--peak-paper);
  color: var(--peak-ink);
  box-shadow: 0 .75rem 2.25rem #060c1ac4;
}
.taehak-helper-heading {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .55rem .35rem 1rem;
  border-bottom: 1px solid var(--peak-line, #3c4940);
  background: var(--peak-panel, #1c2520);
}
.taehak-helper-heading h2 { margin: 0; color: var(--peak-green, #e3eade); font-size: 1rem; line-height: 1.5; letter-spacing: -.025em; }
.taehak-helper-heading-text { min-width: 0; }
.taehak-helper-context { margin: .12rem 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--peak-muted, #b8bdb0); font-size: .75rem; }
.taehak-helper-actions { display: flex; flex: none; align-items: center; gap: .1rem; }
.taehak-helper .taehak-helper-window-control {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  box-shadow: none;
  color: var(--peak-ink, #eeeae0);
}
.taehak-helper .taehak-helper-window-control:hover { background: var(--peak-selected, #2b3b30); }
.taehak-helper-window-control svg { display: block; }
.taehak-helper:not([data-helper-size="large"]) .taehak-helper-restore-icon,
.taehak-helper[data-helper-size="large"] .taehak-helper-maximize-icon { display: none; }
@media (pointer: coarse) {
  .taehak-helper .taehak-helper-window-control { width: 2.75rem; height: 2.75rem; min-height: 2.75rem; }
}
.taehak-helper-thread {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: .8rem;
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--peak-line, #3c4940) transparent;
}
.taehak-helper-thread > * { flex: none; }
.taehak-helper-result { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; width: 100%; }
.taehak-helper-result:has(> [hidden]:only-child) { display: none; }
.taehak-helper-intro { width: 100%; font-size: .875rem; line-height: 1.65; }
.taehak-helper-intro h3 { margin: 0 0 .45rem; color: var(--peak-green, #e3eade); font-size: 1rem; }
.taehak-helper-intro p { margin: .45rem 0; }
.taehak-helper-examples { display: flex; margin-block: .8rem; }
.taehak-helper .taehak-helper-examples button { min-height: 2.75rem; padding: .45rem .65rem; margin: 0; border: 1px solid var(--peak-line, #3c4940); border-radius: .5rem; background: var(--peak-field, #151e18); box-shadow: none; color: var(--peak-accent, #e5ba79); text-align: start; font-size: .875rem; }
.taehak-helper .taehak-helper-examples button:hover { background: var(--peak-selected, #2b3b30); }
.taehak-helper-message {
  flex: none;
  min-width: 0;
  max-width: 94%;
  padding: .75rem .85rem;
  border: 1px solid var(--peak-line, #3c4940);
  border-radius: .9rem .9rem .9rem .25rem;
  background: var(--peak-panel, #1c2520);
  font-size: .86rem;
  line-height: 1.7;
}
.taehak-helper-message-user {
  align-self: flex-end;
  max-width: 88%;
  border-color: #6e92c7;
  border-radius: .9rem .9rem .25rem .9rem;
  background: #4068a2;
  color: var(--peak-green, #e3eade);
}
.taehak-helper-message h3 { margin: 0 0 .5rem; font-size: .9rem; color: var(--peak-green, #e3eade); }
.taehak-helper-message p { margin: .6rem 0 0; white-space: pre-wrap; }
.taehak-helper-message > :first-child { margin-top: 0; }
.taehak-helper-message > :last-child { margin-bottom: 0; }
.taehak-helper-message:has(.taehak-helper-comparison) { width: 100%; max-width: 100%; }
.taehak-helper-comparison { max-width: 100%; margin-top: .85rem; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.taehak-helper-comparison table { width: 100%; min-width: 19rem; border-collapse: collapse; table-layout: fixed; font-size: .875rem; line-height: 1.6; }
.taehak-helper-comparison[data-columns="3"] table { min-width: 27rem; }
.taehak-helper-comparison caption { padding-bottom: .45rem; text-align: start; color: var(--peak-muted, #b8bdb0); font-size: .75rem; }
.taehak-helper-comparison th, .taehak-helper-comparison td { padding: .55rem .45rem; border: 1px solid var(--peak-line, #3c4940); vertical-align: top; text-align: start; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.taehak-helper-comparison th { background: var(--peak-field, #151e18); color: var(--peak-accent, #e5ba79); font-weight: 600; }
.taehak-helper-comparison th:first-child { width: 4.5rem; }
.taehak-helper-pending { color: var(--peak-muted, #b8bdb0); }
.taehak-helper-links { display: grid; gap: .35rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.taehak-helper-links a { display: block; padding: .5rem .6rem; border: 1px solid var(--peak-line, #3c4940); border-radius: .45rem; color: var(--peak-accent, #e5ba79); font-size: .8rem; text-decoration: none; }
.taehak-helper-links a:hover { background: var(--peak-selected, #2b3b30); }
.taehak-helper .taehak-helper-form { display: block; flex: none; margin: 0; padding: .55rem .8rem; border-top: 1px solid var(--peak-line, #3c4940); }
.taehak-helper-composer {
  --helper-input-size: 2.375rem;
  display: flex;
  align-items: flex-end;
  gap: .375rem;
  padding: .25rem;
  border: 1px solid var(--peak-line);
  border-radius: .8rem;
  background: var(--peak-field);
}
.taehak-helper-composer:focus-within { border-color: var(--peak-action, #d9b478); }
.taehak-helper .taehak-helper-form textarea {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: var(--helper-input-size);
  max-height: 8rem;
  margin: 0;
  resize: none;
  padding: calc((var(--helper-input-size) - 1.5rem) / 2) .5rem;
  border: 0;
  border-radius: .65rem;
  outline-offset: -2px;
  background: transparent;
  box-shadow: none;
  color: var(--peak-ink, #eeeae0);
  font-size: 1rem;
  line-height: 1.5;
}
.taehak-helper .taehak-helper-attach {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--helper-input-size);
  height: var(--helper-input-size);
  min-height: var(--helper-input-size);
  padding: 0;
  border: 1px solid var(--peak-line, #3c4940);
  border-radius: .6rem;
  background: transparent;
  color: var(--peak-accent, #e5ba79);
  font-size: 1.4rem;
  line-height: 1;
}
.taehak-helper-photos {
  display: grid;
  gap: .35rem;
  margin-block-start: .55rem;
  color: var(--peak-muted, #b8bdb0);
  font-size: .8rem;
}
.taehak-helper-photo-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.taehak-helper .taehak-helper-photo-actions button {
  min-height: 2.5rem;
  padding: .2rem .45rem;
  border: 1px solid var(--peak-line, #3c4940);
  border-radius: .45rem;
  background: var(--peak-field, #151e18);
  color: var(--peak-accent, #e5ba79);
}
.taehak-helper .taehak-helper-photo-actions [data-helper-photo-remove] { color: var(--peak-muted, #b8bdb0); }
.taehak-helper .taehak-helper-attach:hover, .taehak-helper .taehak-helper-photo-actions button:hover {
  background: var(--peak-selected, #2b3b30);
}
.taehak-helper-review {
  flex: none;
  max-height: 38%;
  padding: .5rem .75rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border-block-start: 1px solid var(--peak-line, #3c4940);
  color: var(--peak-muted, #b8bdb0);
  font-size: .825rem;
}
.taehak-helper-review :is(select, input:not([type="checkbox"]), button) {
  min-height: 2.25rem;
  border: 1px solid var(--peak-line, #3c4940);
  border-radius: .38rem;
  padding: .2rem .4rem;
  background: var(--peak-field, #151e18);
  color: var(--peak-ink, #eeeae0);
  font: inherit;
}
.taehak-helper-review :is(select, input) { max-width: 100%; }
.taehak-helper-review input[type="checkbox"] { accent-color: var(--peak-accent, #e5ba79); }
.taehak-helper-correction { display: grid; justify-items: start; gap: .25rem; padding-block: .4rem; }
.taehak-helper-correction summary { cursor: pointer; color: var(--peak-accent, #e5ba79); }
.taehak-helper-correction .st-fields { display: grid; gap: .45rem; margin-block: .35rem; }
.taehak-helper-correction .st-fields p { margin: 0; }
.taehak-helper-correction .st-fields label { display: grid; gap: .25rem; }
.taehak-helper-correction .st-fields label:has(input[type="checkbox"]) { display: block; }
.taehak-helper-correction .st-fields label input[type="checkbox"] { margin-inline-start: .35rem; }
.taehak-helper-correction .st-fields button { justify-self: start; }
.taehak-helper-learning-audit { margin: .2rem 0 .4rem; padding-inline-start: 1.15rem; }
.taehak-helper-evidence { display: grid; gap: .3rem; margin-block: .65rem; }
.taehak-helper-evidence p { margin: 0; }
.taehak-helper-evidence strong { color: var(--peak-accent, #e5ba79); }
.taehak-helper-evidence a { color: var(--peak-accent, #e5ba79); }
.taehak-helper-message[data-helper-paragraphs="spaced"] > p + p { margin-block-start: .95rem; }
.taehak-helper-panel:has(.taehak-helper-frame:not([hidden])) .taehak-helper-tool-message { flex: none; }
.taehak-helper-form textarea::placeholder { color: var(--peak-muted, #b8bdb0); opacity: .85; }
.taehak-helper .taehak-helper-send {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--helper-input-size);
  height: var(--helper-input-size);
  min-height: var(--helper-input-size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: .7rem;
  background: var(--peak-action, #d9b478);
  color: var(--peak-action-ink, #202119);
  box-shadow: none;
}
.taehak-helper-send svg { display: block; }
.taehak-helper .taehak-helper-send:hover:not(:disabled) { background: var(--peak-accent, #e5ba79); }
.taehak-helper-status { margin: .45rem 0 0; color: var(--peak-muted, #b8bdb0); font-size: .75rem; }
.taehak-helper-status:empty { display: none; }
.taehak-helper .taehak-helper-retry { min-height: 2.75rem; margin: .65rem 0 0; padding: .4rem .65rem; border: 1px solid var(--peak-line, #3c4940); border-radius: .5rem; background: transparent; color: var(--peak-accent, #e5ba79); box-shadow: none; font-size: .8rem; }
@media (pointer: coarse), (max-width: 40rem) {
  .taehak-helper-composer { --helper-input-size: 2.75rem; }
}
@media (max-width: 380px) {
  .taehak-helper { inset-inline-end: max(.65rem, env(safe-area-inset-right)); inset-block-end: max(.65rem, env(safe-area-inset-bottom)); max-width: calc(100% - 1.3rem); }
  .taehak-helper-heading, .taehak-helper-thread, .taehak-helper .taehak-helper-form { padding-inline: .7rem; }
  .taehak-helper-message { max-width: 96%; padding: .65rem .75rem; }
}
.taehak-helper-tool-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .45rem .75rem;
}
.taehak-helper .taehak-helper-return {
  align-self: flex-start;
  flex: none;
  min-height: 2.5rem;
  padding: .3rem .55rem;
  border: 1px solid var(--peak-line, #3c4940);
  border-radius: .45rem;
  background: var(--peak-field, #151e18);
  color: var(--peak-green, #e3eade);
}
.taehak-helper .taehak-helper-return:hover { background: var(--peak-selected, #2b3b30); }
.taehak-helper-tool-message { padding: .25rem 0; }
.taehak-helper-tool-message p { margin: 0 0 .5rem; }
.taehak-helper-tool-message a { color: var(--peak-accent, #e5ba79); }
.taehak-helper-frame { inline-size: 100%; min-block-size: 2.5rem; border: 0; }
.taehak-helper[data-helper-size="large"] .taehak-helper-panel {
  width: min(56rem, calc(100vw - 2rem));
  height: min(49rem, calc(100dvh - 2rem - env(safe-area-inset-bottom)));
}
.taehak-helper[data-helper-size="large"]:has([data-helper-panel]:not([hidden])) .taehak-helper-launch { display: none; }
@media (max-width: 40rem), (max-height: 32rem) and (pointer: coarse) {
  .taehak-helper[data-helper-size="large"]:has([data-helper-panel]:not([hidden])) {
    inset: 0;
    max-width: none;
    z-index: 60;
  }
  .taehak-helper[data-helper-size="large"] .taehak-helper-panel {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding-block: env(safe-area-inset-top) env(safe-area-inset-bottom);
    border: 0;
    border-radius: 0;
  }
  html:has(.taehak-helper[data-helper-size="large"] [data-helper-panel]:not([hidden])) { overflow: hidden; }
}


.taehak-helper-message:has(.taehak-helper-lineup) { width: 100%; max-width: 100%; }
.taehak-helper-lineup { margin: .65rem 0; padding: .55rem; border: 1px solid var(--peak-line, #3c4940); border-radius: .5rem; background: var(--peak-field, #151e18); }
.taehak-helper-lineup-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.taehak-helper-lineup-heading h4 { margin: 0; font-size: 1rem; }
.taehak-helper-lineup-heading span { color: var(--peak-accent, #e5ba79); font-size: .85rem; }
.taehak-helper-lineup-row { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: .25rem; align-items: stretch; margin-top: .25rem; }
.taehak-helper-lineup-label { align-self: center; color: var(--peak-muted, #b8bdb0); font-size: .75rem; }
.taehak-helper-lineup-slot { display: flex; flex-direction: column; gap: .15rem; align-items: center; justify-content: center; min-height: 3rem; padding: .25rem; border: 1px solid var(--peak-line, #3c4940); border-radius: .35rem; text-align: center; font-size: .82rem; overflow-wrap: anywhere; }
.taehak-helper-lineup-slot:has(strong) { background: var(--peak-panel, #1c2520); }
.taehak-helper-lineup-slot small { color: var(--peak-muted, #b8bdb0); font-size: .72rem; }
.taehak-helper-lineup-slot img { width: 2rem; height: 2.5rem; object-fit: cover; border-radius: .2rem; }
.taehak-helper-lineup-tactics { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: .3rem .6rem; margin: .65rem 0 0; font-size: .85rem; }
.taehak-helper-lineup-tactics dt { font-weight: 650; color: var(--peak-ink, #eeeae0); }
.taehak-helper-lineup-tactics dd { margin: 0; overflow-wrap: anywhere; }
