/* ==========================================================================
   css/feedback.css — the header help menu and the feedback dialog (js/feedback.js)
   Ported from hawaiistorm.com css/feedback.css. Colour and type from the
   tokens in index.html only, so light and dark both follow the theme.
   ========================================================================== */

/* ---- help menu ------------------------------------------------------------ */

.ks-help { position: relative; flex: none; }
#help-toggle { font-weight: 800; min-width: 32px; padding: 0 11px; }
#help-toggle[aria-expanded="true"] { color: var(--text); background: var(--bg-panel-3); border-color: var(--border-strong); }

.ks-helpmenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 13rem;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  box-shadow: var(--shadow-pop);
}
.ks-helpmenu[hidden] { display: none; }
.ks-helpmenu__item {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.ks-helpmenu__item:hover,
.ks-helpmenu__item:focus-visible { background: var(--bg-panel-2); outline: none; }
.ks-helpmenu__sep { height: 1px; margin: 4px 6px; background: var(--border); }

/* ---- footer link ---------------------------------------------------------- */

/* A button (it opens a dialog, it goes nowhere) that reads as the footer's links. */
.ks-footer__feedback {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---- dialog --------------------------------------------------------------- */

.ks-iconbtn {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-panel-2);
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
}
.ks-iconbtn:hover { color: var(--text); background: var(--bg-panel-3); }

.ks-feedback {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  overflow: auto;
}
.ks-feedback::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.ks-feedback__form,
.ks-feedback__done {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}
.ks-feedback__form[hidden],
.ks-feedback__done[hidden] { display: none; }
.ks-feedback__head { display: flex; align-items: center; gap: 8px; }
.ks-feedback__title { flex: 1 1 auto; margin: 0; font-size: 18px; font-weight: 800; }
.ks-feedback__lede { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.ks-feedback__field { display: flex; flex-direction: column; gap: 6px; }
.ks-feedback__label { font-size: 12px; font-weight: 700; color: var(--text); }
.ks-feedback__opt { font-weight: 500; color: var(--text-faint); }
.ks-feedback textarea,
.ks-feedback input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-panel-2);
  color: var(--text);
  /* 16px: iOS zooms the page into any smaller field on focus. */
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
}
.ks-feedback textarea { resize: vertical; min-height: 8rem; }
.ks-feedback textarea:focus-visible,
.ks-feedback input[type="email"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The honeypot. Off-screen rather than display:none, which some bots skip. */
.ks-feedback__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.ks-feedback__context { margin: 0; font-size: 11px; line-height: 1.45; color: var(--text-faint); }
.ks-feedback__status { margin: 0; min-height: 1.2em; font-size: 12px; color: var(--text-dim); }
.ks-feedback__status:empty { display: none; }
.ks-feedback__status[data-kind="err"] { color: var(--poor); font-weight: 700; }
.ks-feedback__actions { display: flex; justify-content: flex-end; gap: 8px; }
.ks-feedback__actions .refresh-btn { height: 36px; padding: 0 16px; font-size: 13px; }
.ks-feedback__actions .refresh-btn[disabled] { opacity: 0.6; cursor: progress; }

@media (pointer: coarse) {
  .ks-helpmenu__item { min-height: 44px; }
  .ks-footer__feedback { min-height: 44px; }
}
