/* The look of the Android shell (design-direction.md section 11; the structure is 95-native-shell.css, and iOS's look, which this
   overrides where Material says otherwise, is 96-native-ios.css).

   What an Android user expects of an app and Material Design 3 says: a navigation bar the width of the screen, tinted and not blurred,
   with the selected destination's drawing in a pill; flat lists on the sheet's own surface with the subheading in the accent; a bottom
   sheet with a drag handle and the 28dp corners; Roboto at the size the person chose; and a pressed state that is a wash over the
   control (the state layer), not a scale. Tessera is in it by the accent on the indicator and the tessera colors on the rows' circles.
   Tokens only; no color is written. Specificity is one attribute value above 96's, so this wins whatever the order. */

[data-native="android"] {
  --native-tabs-h: calc(4.75rem + var(--safe-bottom));
  --native-tabs-offset: 0px;
  --native-group-radius: 0;
  --native-sheet-radius: 1.75rem;
}

/* ── The navigation bar ──────────────────────────────────────────────────
   Edge to edge and tinted from the accent (Material's surface container), a hairline above it. The label sits under a pill that
   holds the drawing, and the pill is filled only for the selected destination; the label then gets heavier and darker. Five pills of Material's
   64dp need 320 CSS px, and a page must reflow at 320 (WCAG 1.4.10) with room to spare for the sides, so the pill gives way to its tab. */
[data-native="android"] .native-tabs {
  padding-inline: 0;
}
[data-native="android"] .native-tabs-list {
  gap: 0;
  max-inline-size: none;
  margin-inline: 0;
  padding-block: 0.75rem calc(0.75rem + var(--safe-bottom));
  padding-inline: max(var(--safe-left), var(--safe-right));
  border: 0;
  border-block-start: 1px solid var(--rule);
  border-radius: 0;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-raised));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
[data-native="android"] .native-tab {
  gap: 0.25rem;
  padding: 0;
  border-radius: 0;
  color: var(--fg2);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1rem;
  letter-spacing: 0.02em;
}
[data-native="android"] .native-tab-icon {
  inline-size: 4rem;
  max-inline-size: 100%;
  block-size: 2rem;
  border-radius: 1rem;
  transition: background-color 200ms ease;
}
[data-native="android"] .native-tab[aria-current="page"] {
  background: transparent;
  color: var(--fg1);
  font-weight: 700;
}
/* The indicator is the accent over the bar, not the theme's soft tint: in dark the soft tint is a hair from the bar's own colour and the
   selected destination read as unselected but for its icon. Over the bar, the same strength in both modes. */
[data-native="android"] .native-tab[aria-current="page"] .native-tab-icon {
  background: color-mix(in srgb, var(--accent) 26%, var(--surface-raised));
  color: var(--accent-text);
}
[data-native="android"] .native-tab[aria-current="page"] .icon {
  fill: color-mix(in srgb, currentColor 22%, transparent);
  stroke-width: 2;
}
[data-native="android"] .native-tab:active {
  transform: none;
}
[data-native="android"] .native-tab:active .native-tab-icon {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* ── The assistant ───────────────────────────────────────────────────────
   Material's floating action button: a 56dp rounded square (16dp corners) in the tonal container, the accent for its drawing, on its own
   elevation. Pressed, it is the wash of the state layer. */
[data-native="android"] .assistant-fab {
  border: 0;
  border-radius: 1rem;
  background: var(--accent-soft);
  color: var(--accent-text);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: var(--shadow-lift);
}
[data-native="android"] .assistant-fab:active {
  transform: none;
  background: color-mix(in srgb, var(--accent) 18%, var(--accent-soft));
}

/* ── The sheet ───────────────────────────────────────────────────────────
   The sheet's own surface, flat lists with a subheading in the accent in sentence case, and rows at Material's 56dp with a circle
   for the drawing. The state layer is a wash of the text color over the whole row. */
[data-native="android"] .native-menu {
  background: var(--surface-raised);
}
[data-native="android"] .native-group-title {
  padding-inline: var(--space-4);
  color: var(--accent-text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}
[data-native="android"] .native-group-list {
  margin-inline: 0;
  border-radius: 0;
  background: transparent;
}
[data-native="android"] .native-row {
  min-block-size: 3.5rem;
  padding-inline: var(--space-4);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}
[data-native="android"] .native-group-list > li + li > .native-row::before {
  inset-inline: calc(var(--space-4) + 2.5rem + var(--space-3)) var(--space-4);
}
[data-native="android"] .native-row:active {
  background: color-mix(in srgb, var(--fg1) 10%, transparent);
}
[data-native="android"] .native-tile {
  inline-size: 2.5rem;
  block-size: 2.5rem;
  border-radius: 50%;
}
[data-native="android"] .native-account-who {
  padding-inline: var(--space-4);
  font-size: 1rem;
  font-weight: 600;
}
[data-native="android"] .native-appearance .mode-switch {
  margin-inline: var(--space-4);
}

/* ── Buttons ─────────────────────────────────────────────────────────────
   Material's: filled, filled tonal and text buttons, all full pills, at 15px medium with the little extra spacing Material sets, and no
   scale under the finger. Pressed, the whole control is washed with its own text color at 14% (the state layer), drawn as an inset shadow so
   the pill's shape clips it, and nothing moves. */
[data-native="android"] .btn {
  min-block-size: 3rem;
  padding-block: 0.5rem;
  padding-inline: 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25rem;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
[data-native="android"] .btn-sm {
  min-block-size: var(--target-min);
  padding-inline: 1.125rem;
  font-size: 0.875rem;
}
[data-native="android"] .btn-lg {
  min-block-size: 3.5rem;
  padding-inline: 2rem;
  font-size: 1rem;
}
[data-native="android"] .btn-secondary {
  --btn-bg: var(--accent-soft);
  --btn-fg: var(--accent-text);
  --btn-border: transparent;
}
[data-native="android"] .btn-quiet {
  --btn-bg: transparent;
  --btn-fg: var(--accent-text);
  --btn-border: transparent;
  padding-inline: 0.75rem;
  font-weight: 500;
}
[data-native="android"] .btn:active:where(:not(:disabled, [aria-disabled="true"])) {
  opacity: 1;
  transform: none;
  box-shadow: inset 0 0 0 999px color-mix(in srgb, currentColor 14%, transparent);
}

/* ── Fields and cards ────────────────────────────────────────────────────
   Material's outlined field at 16px with an 8px corner, and outlined cards at 12px. Entries stay separate cards in a list (Material's lists of
   cards), each with the chevron that says it opens: the iOS file's grouping is for iOS only. */
[data-native="android"] {
  --native-field-radius: 0.5rem;
  --native-card-radius: 0.75rem;
}
[data-native="android"] .field .field-control {
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  [data-native="android"] .native-tab-icon,
  [data-native="android"] .btn {
    transition: none;
  }
}

/* ── The way back: Android's mark ────────────────────────────────────────
   The arrow (Material's navigation icon), not iOS's chevron. A sheet has Material's drag handle over its header, because the native sheet draws no
   bar to carry one: a short rounded bar, centered, in the quiet text color. */
[data-native="android"] .native-back-chevron {
  display: none;
}
[data-native="android"] .native-back-arrow {
  display: inline;
  stroke-width: 2;
}
[data-native="android"][data-native-modal] .native-main::before {
  content: "";
  display: block;
  inline-size: 2rem;
  block-size: 0.25rem;
  margin-inline: auto;
  margin-block-end: var(--space-2);
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg2) 45%, transparent);
}
