/* Gruzingo controls. Load last; layout and action handlers stay with their screens. */
:root {
  --button-coral: #be4f39;
  --button-coral-hover: #ad432f;
  --button-coral-edge: #923b2b;
  --button-green: #285f4b;
  --button-line: #cedbce;
  --button-ease: cubic-bezier(.2,.75,.25,1);
  --button-fast: 140ms;
}

/* Shared shape, touch target and tactile response, without changing widths. */
:is(.primary,.secondary,.ghost,.danger,.small-btn,.continue,.recheck,
    .welcome-login,.welcome-intro-skip,.welcome-replay,.pwa-update-banner button) {
  position: relative;
  min-height: 44px;
  border-radius: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--button-fast) ease, color var(--button-fast) ease,
    border-color var(--button-fast) ease, box-shadow var(--button-fast) ease,
    transform var(--button-fast) var(--button-ease);
}
:is(.primary,.continue),.welcome-landing .primary {
  color: #fff;
  background: var(--button-coral);
  border: 1px solid transparent;
  box-shadow: 0 3px 0 var(--button-coral-edge), 0 5px 10px #7d40200d;
}
:is(.secondary,.small-btn,.welcome-login,.welcome-intro-skip,.welcome-replay,.recheck),
.owner-main .small-btn {
  color: var(--button-green);
  background: #f0f5ed;
  border: 1px solid var(--button-line);
  box-shadow: 0 2px 0 #d5dfd1;
}
:is(.ghost) {
  color: #536359;
  background: #fff;
  border: 1px solid #d6ded5;
  box-shadow: 0 2px 0 #e6eae2;
}
:is(.danger,.owner-variant-delete),.owner-main .owner-variant-delete {
  color: #9f363c;
  background: #fff3f0;
  border: 1px solid #eacac3;
  box-shadow: 0 2px 0 #efd8d1;
}
.owner-main .small-btn { border-radius:14px; font-weight:700; line-height:1.35; }
.owner-editor-head > button { align-self:flex-start; }
.recheck { padding:10px 16px; }
.guidance-check { min-height:44px; touch-action:manipulation; }
/* Bank-result pages keep their explicit failure/success colours. */
body[data-payment-page="error"] .continue {
  background: #b73d43;
  box-shadow: 0 3px 0 #943039;
}
body[data-payment-state="paid"][data-payment-page="error"] .continue {
  background: #356846;
  box-shadow: 0 3px 0 #254c32;
}

/* Selectable cards are distinct from buttons that immediately perform actions. */
:is(.answer,.option,.primer-option,.token,.pill,.course-group) {
  touch-action: manipulation;
  transition: background-color var(--button-fast) ease, border-color var(--button-fast) ease,
    box-shadow var(--button-fast) ease, transform var(--button-fast) var(--button-ease);
}
:is(.answer,.option,.primer-option) {
  border-radius: 16px;
  box-shadow: 0 3px 0 #e2e7dc;
}
:is(.answer.selected,.option.selected,.primer-option.selected) {
  border-color: #568668;
  background: #edf5e9;
  box-shadow: 0 3px 0 #a4c0a3;
}
.answer.selected .key {
  color: #fff;
  border-color: #386c50;
  background: #386c50;
}
.answer.correct { border-color: #51805e; background: #e6f3df; box-shadow: 0 3px 0 #a6c09e; }
:is(.answer.incorrect,.primer-option.selected.wrong) {
  border-color: #c07963;
  background: #fff1eb;
  box-shadow: 0 3px 0 #e8c4b8;
}
:is(.pill,.course-group) { min-height:44px; color:#506451; }
:is(.pill.active,.course-group.active,.owner-main .small-btn.active) {
  color: #235c43;
  border-color: #75a082;
  background: #e6f1e2;
  box-shadow: inset 0 0 0 1px #75a082;
}

/* Audio and close controls remain compact and easy to hit with a thumb. */
:is(.sound-button,.close-btn,.report-problem,.avatar,.pwa-close) {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  transition: background-color var(--button-fast) ease, border-color var(--button-fast) ease,
    box-shadow var(--button-fast) ease, transform var(--button-fast) var(--button-ease);
}
.sound-button,.sound-controls .sound-slow {
  color: #315f45;
  background: #edf3e6;
  border: 1px solid #c8d7bd;
  border-radius: 13px;
  box-shadow: 0 2px 0 #d1dec6;
}
.sound-controls .sound-slow { min-height:44px; height:auto; }
:is(.link-btn,.welcome-account) { min-height:44px; color:#276753; touch-action:manipulation; }
:is(.nav button,.owner-tabs button,.auth-tabs button) {
  min-height:44px;
  touch-action:manipulation;
  transition: background-color var(--button-fast) ease, color var(--button-fast) ease,
    border-color var(--button-fast) ease;
}

/* Hover is only for a real pointer: mobile taps must not leave sticky hover. */
@media (hover:hover) and (pointer:fine) {
  :is(.primary,.continue):not(:disabled):not([aria-disabled="true"]):hover,
  .welcome-landing .primary:not(:disabled):hover {
    color:#fff; background:var(--button-coral-hover); transform:translateY(-1px);
  }
  :is(.secondary,.small-btn,.welcome-login,.welcome-intro-skip,.welcome-replay,.recheck):not(:disabled):hover {
    background:#e5efdf; border-color:#a8bea6; transform:translateY(-1px);
  }
  .ghost:not(:disabled):hover { background:#f3f5ef; border-color:#b3c3b4; transform:translateY(-1px); }
  :is(.danger,.owner-variant-delete):not(:disabled):hover,.owner-main .owner-variant-delete:not(:disabled):hover { color:#8d2e34; background:#fce5df; border-color:#d5a59b; }
  :is(.answer,.option,.primer-option):not(:disabled):not(.selected):hover { border-color:#a6b9a3; background:#f8faf5; }
  :is(.token,.sound-button):not(:disabled):hover { background:#e4eedc; border-color:#a4bd96; }
  :is(.close-btn,.report-problem,.avatar):not(:disabled):hover { background:#e8eee3; }
  :is(.link-btn,.welcome-account):not(:disabled):hover { color:#164d3b; text-decoration:underline; text-underline-offset:4px; }
  body[data-payment-page="error"] .continue:not(:disabled):hover { background:#a53039; }
  body[data-payment-state="paid"][data-payment-page="error"] .continue:not(:disabled):hover { background:#285736; }
}
:is(.primary,.secondary,.ghost,.danger,.small-btn,.continue,.recheck,
    .welcome-login,.welcome-intro-skip,.welcome-replay,.answer,.option,.primer-option,
    .token,.sound-button):not(:disabled):not([aria-disabled="true"]):active {
  transform:translateY(2px);
  box-shadow:0 1px 0 #68765c38;
}
/* Navigation nodes have their own positioning transform, so never override it. */
:is(.journey-lesson,.primer-path-card):not(:disabled):active { filter:brightness(.97); }

/* Inactive actions must look inactive even if the pointer remains over them. */
:is(.primary,.secondary,.ghost,.danger,.small-btn,.continue,.recheck):disabled,
:is(.primary,.secondary,.ghost,.danger,.small-btn,.continue,.recheck)[aria-disabled="true"],
.owner-main .small-btn:disabled,.payment-error .continue:disabled {
  opacity:1;
  color:#788374;
  background:#e9ede4;
  border:1px solid #d9e0d2;
  box-shadow:none;
  transform:none;
  cursor:not-allowed;
}
:is(.sound-button,.close-btn,.report-problem):disabled { opacity:.5; box-shadow:none; transform:none; cursor:not-allowed; }
/* Answer feedback remains readable while controls are locked after submission. */
:is(.answer,.primer-option):disabled { opacity:1; cursor:default; transform:none; }
:is(button,a,input,select,textarea):focus-visible {
  outline:3px solid #246b55;
  outline-offset:4px;
}
/* Account requests explicitly mark busy; a stable outline avoids shifting labels. */
button[aria-busy="true"] { cursor:progress; }
button[aria-busy="true"]::after {
  content:"";
  position:absolute;
  inset:-3px;
  border:2px solid #568668;
  border-radius:inherit;
  pointer-events:none;
  animation:button-wait 1.2s ease-in-out infinite alternate;
}
@keyframes button-wait { from { opacity:.3; } to { opacity:1; } }
@media (pointer:coarse) {
  .owner-main .small-btn { min-height:44px; }
}
@media (prefers-reduced-motion:reduce) {
  button, a { transition:none!important; animation:none!important; }
  button::after { animation:none!important; }
  :is(.primary,.secondary,.ghost,.danger,.small-btn,.continue,.recheck,.answer,.option,
      .primer-option,.token,.sound-button):hover,
  :is(.primary,.secondary,.ghost,.danger,.small-btn,.continue,.recheck,.answer,.option,
      .primer-option,.token,.sound-button):active { transform:none!important; }
}
@media (forced-colors:active) {
  :is(.primary,.secondary,.ghost,.danger,.small-btn,.continue,.sound-button) { border:1px solid ButtonText; }
  :is(.answer.selected,.option.selected,.primer-option.selected) { outline:2px solid Highlight; outline-offset:-4px; }
}

/* The detailed Guri mark uses the same rounded tile across current screens. */
.brand img,.pwa-brand{border-radius:24%;object-fit:contain}
