/*
 * Mike In Good Auth Entry Foundation v4
 * Shared geometry only. Palette, typography family, materials, viewport,
 * safe-area and scroll ownership remain app-owned.
 */
[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] {
  --auth-entry-inline: 420px;
  --auth-entry-padding: 18px;
  --auth-entry-radius: 20px;
  --auth-entry-region-gap: 12px;
  --auth-entry-form-gap: 10px;
  --auth-entry-field-gap: 4px;
  box-sizing: border-box;
  inline-size: min(100%, var(--auth-entry-inline));
  max-inline-size: var(--auth-entry-inline);
  min-inline-size: 0;
  block-size: auto;
  min-block-size: 0;
  margin: auto;
  padding: var(--auth-entry-padding);
  border-radius: var(--auth-entry-radius);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "identity"
    "description"
    "auth"
    "account-help";
  grid-template-rows: repeat(4, max-content);
  align-content: start;
  align-self: center;
  gap: var(--auth-entry-region-gap);
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root],
[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] *,
[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] *::before,
[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] *::after {
  box-sizing: border-box;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] > [data-app-entry-region] {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 0;
  margin: 0;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] > [data-app-entry-region="identity"] {
  grid-area: identity;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] > [data-app-entry-region="description"] {
  grid-area: description;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] > [data-app-entry-region="auth"] {
  grid-area: auth;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] > [data-app-entry-region="account-help"] {
  grid-area: account-help;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-identity] {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-inline-size: 0;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-mark] {
  inline-size: 44px;
  block-size: 44px;
  min-inline-size: 44px;
  min-block-size: 44px;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-title] {
  margin: 0;
  font-size: clamp(24px, 6vw, 26px);
  line-height: 1.05;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-copy] {
  min-inline-size: 0;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-auth-tabs] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-inline-size: 0;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-auth-tab] {
  min-block-size: 40px;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-auth-pane][hidden] {
  display: none;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-form] {
  display: grid;
  gap: var(--auth-entry-form-gap);
  min-inline-size: 0;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-field] {
  display: grid;
  gap: var(--auth-entry-field-gap);
  min-inline-size: 0;
  margin: 0;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] :where(input:not([type]), input[type="text"], input[type="email"], input[type="password"]) {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  font-size: max(16px, 1em);
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-primary-action] {
  min-block-size: 44px;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] :where(.auth-check, .legal-check, .auth-consent, .air-auth-check, .legal-checkbox) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-inline-size: 0;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] :where(.auth-check, .legal-check, .auth-consent, .air-auth-check, .legal-checkbox) input {
  margin: 2px 0 0;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-feedback]:empty,
[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-feedback][hidden] {
  display: none;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-app-entry-account-copy] {
  margin: 0;
  text-align: center;
  text-transform: none;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-auth-entry-legal-links] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
}

[data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-auth-entry-legal-links] a {
  min-block-size: 32px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 520px) {
  [data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] {
    --auth-entry-padding: 14px;
    --auth-entry-region-gap: 10px;
  }
}

@media (max-height: 700px) {
  [data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] {
    --auth-entry-padding: 14px;
    --auth-entry-region-gap: 8px;
    --auth-entry-form-gap: 8px;
  }
}

@media (pointer: coarse) {
  [data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] [data-auth-entry-legal-links] a {
    min-block-size: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-auth-entry-canon="compact-panel-v3"][data-app-entry-root],
  [data-auth-entry-canon="compact-panel-v3"][data-app-entry-root] * {
    scroll-behavior: auto;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

/*
 * Specificity escrow for first-wave skins that still retain the frozen v1/v2
 * 900px source projection. The matching branches remain attribute-owned; the
 * phantom IDs only let this shared v3 geometry outrank historical selectors.
 */
:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) {
  inline-size: min(100%, var(--auth-entry-inline));
  max-inline-size: var(--auth-entry-inline);
  min-inline-size: 0;
  block-size: auto;
  min-block-size: 0;
  margin: auto;
  padding: var(--auth-entry-padding);
  border-radius: var(--auth-entry-radius);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "identity"
    "description"
    "auth"
    "account-help";
  grid-template-rows: repeat(4, max-content);
  align-content: start;
  align-self: center;
  gap: var(--auth-entry-region-gap);
}

:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) > [data-app-entry-region="identity"] {
  grid-area: identity;
}

:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) > [data-app-entry-region="description"] {
  grid-area: description;
}

:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) > [data-app-entry-region="auth"] {
  grid-area: auth;
}

:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) > [data-app-entry-region="account-help"] {
  grid-area: account-help;
}

:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) [data-app-entry-auth-tab] {
  min-block-size: 40px;
}

:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) :where(input:not([type]), input[type="text"], input[type="email"], input[type="password"]) {
  min-block-size: 44px;
}

:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) [data-primary-action] {
  min-block-size: 44px;
}

:is(#mig-auth-entry-v3-root-a, [data-auth-entry-canon="compact-panel-v3"]):is(#mig-auth-entry-v3-root-b, [data-app-entry-root]) [data-app-entry-account-copy] {
  text-transform: none;
}
