.mobile-only { display: none; }

.mobile-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}
.mobile-account .actions { margin-inline-start: auto; }
.mobile-menu { display: grid; gap: .55rem; }
.mobile-menu h2 { margin-block: .8rem .1rem; font-size: 1.05rem; }
.mobile-menu a {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 48px;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: #fff;
  text-decoration: none;
  font-weight: 600;
}
.mobile-menu a span:first-child { width: 1.25rem; text-align: center; }

@media screen and (max-width: 820px) {
  :root {
    color: #10274b;
    background: #f7faff;
    --dark: #12365f;
    --green: #0d5798;
    --mint: #e5effb;
    --muted: #526582;
    --line: #dbe5f1;
    --tab-height: 68px;
  }

  .desktop-only { display: none; }
  .mobile-only { display: block; }
  .shell { display: block; padding-block-end: calc(var(--tab-height) + env(safe-area-inset-bottom)); }
  .mobile-header, .content {
    padding-inline-start: max(1rem, env(safe-area-inset-right));
    padding-inline-end: max(1rem, env(safe-area-inset-left));
  }
  .content { min-width: 0; padding-block: 1rem 1.5rem; }
  :focus-visible { outline-color: #2375ba; }
  button, .button { min-height: 44px; }
  input:not([type=checkbox]), select, textarea {
    min-height: 44px;
    min-width: 0;
    border-color: #bdcce0;
    color: #10274b;
    font-size: 1rem;
  }
  .form-grid fieldset { min-inline-size: 0; padding: .65rem; border: 1px solid var(--line); border-radius: .65rem; }
  .table-scroll { overscroll-behavior-inline: contain; }
  .table-scroll table { min-width: max-content; }
  .table-scroll td { max-inline-size: min(58vw, 23rem); }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters input, .filters select { width: 100%; }
  dialog { max-height: 87dvh; }
  .dialog-head {
    position: sticky;
    top: -.9rem;
    z-index: 1;
    background: #fff;
    padding-block: .4rem;
  }
  .auth-screen { padding: 1.1rem; background: linear-gradient(154deg, #125c9c 0%, #12365f 38%, #eff5fc 38%); }
  #app:has(.shell) ~ #toast { bottom: calc(var(--tab-height) + env(safe-area-inset-bottom) + .65rem); }

  .app-icon {
    display: inline-block;
    flex: 0 0 auto;
    inline-size: 24px;
    block-size: 24px;
    background-color: currentColor;
    -webkit-mask: url('/mobile-icons.png') var(--icon-offset, 0%) center / 1000% 100% no-repeat;
    mask: url('/mobile-icons.png') var(--icon-offset, 0%) center / 1000% 100% no-repeat;
  }
  .icon-transactions { --icon-offset: 11.1111%; }
  .icon-messages { --icon-offset: 22.2222%; }
  .icon-more { --icon-offset: 33.3333%; }
  .icon-bell { --icon-offset: 44.4444%; }
  .icon-calendar { --icon-offset: 55.5556%; }
  .icon-purchase { --icon-offset: 66.6667%; }
  .icon-maintenance { --icon-offset: 77.7778%; }
  .icon-check { --icon-offset: 88.8889%; }
  .icon-form { --icon-offset: 100%; }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding-block: calc(.45rem + env(safe-area-inset-top)) .45rem;
    background: white;
    border-block-end: 1px solid var(--line);
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    font-size: clamp(.94rem, 3.65vw, 1.15rem);
    font-weight: 700;
    text-decoration: none;
    line-height: 1.35;
  }
  .mobile-brand img { inline-size: 43px; block-size: 43px; object-fit: contain; border-radius: .4rem; }
  .mobile-brand span { overflow-wrap: anywhere; }
  .mobile-bell {
    flex: 0 0 44px;
    block-size: 44px;
    display: grid;
    place-items: center;
    position: relative;
    color: var(--dark);
    border-radius: .75rem;
  }
  .mobile-badge {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    min-width: 1.15rem;
    min-height: 1.15rem;
    padding-inline: .25rem;
    border: 1px solid #fff;
    border-radius: 20px;
    background: #0e67ac;
    color: white;
    font: 700 .68rem/1.65 Arial, sans-serif;
    text-align: center;
  }

  .mobile-tabs {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    min-height: calc(var(--tab-height) + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .15rem;
    padding: .3rem max(.45rem, env(safe-area-inset-right)) calc(.3rem + env(safe-area-inset-bottom)) max(.45rem, env(safe-area-inset-left));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -5px 16px #16395f0c;
  }
  .mobile-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    text-decoration: none;
    border-radius: .65rem;
    color: #526581;
    min-height: 54px;
    font-size: .77rem;
    font-weight: 700;
  }
  .mobile-tabs a[aria-current] { background: #e4effd; color: #0a5999; }

  .dashboard-mobile { display: grid; gap: 1.05rem; }
  .dashboard-mobile h2 { font-size: 1.08rem; line-height: 1.4; margin-block-end: .6rem; }
  .mobile-hero {
    min-height: 125px;
    display: grid;
    align-content: center;
    gap: .35rem;
    border-radius: 1.05rem;
    padding: 1.2rem;
    background: radial-gradient(ellipse at 0 0, #43aae25c 0 34%, transparent 35%), linear-gradient(112deg, #1978b7, #0e376a);
    color: white;
  }
  .mobile-hero h1 { font-size: clamp(1.4rem, 6vw, 1.9rem); line-height: 1.35; }
  .mobile-hero p { color: #e7f3ff; overflow-wrap: anywhere; }
  .mobile-summary, .mobile-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .mobile-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .3rem;
    background: #e5f0fd;
    color: #132e51;
    border-radius: .85rem;
    padding: .65rem;
    line-height: 1.25;
    min-height: 74px;
    text-decoration: none;
    font-size: clamp(.73rem, 3.25vw, .9rem);
    font-weight: 700;
  }
  .mobile-summary-card strong { display: block; font-size: 1.6rem; margin-block-start: .24rem; color: #0c5ba4; }
  .mobile-summary-card .app-icon, .mobile-recent .app-icon { color: #0e65aa; }
  .mobile-quick button {
    justify-content: flex-start;
    gap: .45rem;
    min-height: 52px;
    padding: .55rem .65rem;
    line-height: 1.35;
    border-radius: .75rem;
    background: linear-gradient(126deg, #1372b5, #0d508e);
    text-align: start;
    font-size: clamp(.8rem, 3.35vw, 1rem);
    overflow-wrap: anywhere;
  }
  .operation-list-mobile { padding-block-end: .55rem; }
  .mobile-recent { list-style: none; display: grid; gap: .55rem; margin: 0; padding: 0; }
  .mobile-recent a {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto auto;
    align-items: center;
    gap: .48rem;
    min-height: 58px;
    padding: .5rem .65rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: #fff;
    text-decoration: none;
  }
  .mobile-operation-name { font-size: .88rem; font-weight: 700; overflow-wrap: anywhere; }
  .mobile-operation-name small { display: block; color: var(--muted); font-size: .7rem; font-weight: 400; text-align: start; }
  .mobile-recent .status { max-width: 8rem; white-space: normal; font-size: .67rem; text-align: center; padding-inline: .36rem; }
  .mobile-chevron { width: 7px; height: 7px; border: solid #687b95; border-width: 0 0 2px 2px; transform: rotate(45deg); }
}
