:root {
  --ink: #172940;
  --secondary: #506077;
  --muted: #616e7b;
  --line: #dce1e5;
  --paper: #fff;
  --bg: #f6f7f8;
  --gold: #e9ae43;
  --goldbg: #fff1cf;
  --navy: #1c314a;
  --green: #116748;
  font:
    16px/1.5 Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button {
  background: none;
  border: 0;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: inherit;
}
button,
a {
  outline-offset: 4px;
}
:focus-visible {
  outline: 3px solid #b88420;
}
button svg,
a svg {
  flex-shrink: 0;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.16;
}
h1 {
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  letter-spacing: -0.055em;
  font-weight: 680;
}
h2 {
  font-size: 1.36rem;
  letter-spacing: -0.036em;
}
h3 {
  font-size: 1rem;
  letter-spacing: -0.018em;
}
button {
  font-weight: 550;
}
svg {
  vertical-align: middle;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand img {
  width: 48px;
  height: 42px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.brand strong,
.brand span {
  display: block;
}
.brand strong {
  font-size: 1.14rem;
  letter-spacing: -0.045em;
  font-weight: 710;
}
.brand span {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.3;
}
.btn,
.textbtn,
.iconbtn,
.navitem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  line-height: 1.25;
}
.btn {
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  min-height: 43px;
  font-size: 0.925rem;
}
.btn:hover {
  border-color: #9dabb6;
  background: #f3f5f6;
}
.primary {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}
.primary:hover {
  background: #304966;
  border-color: #304966;
}
.textbtn {
  font-size: 0.9rem;
  padding: 4px 0;
  color: var(--secondary);
}
.textbtn:hover,
.inline:hover {
  text-decoration: underline;
}
.iconbtn {
  width: 39px;
  height: 39px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--secondary);
}
.iconbtn:hover {
  background: #edf0f2;
}
.inline {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.badge {
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 640;
  border-radius: 5px;
  padding: 5px 8px;
  background: #edf0f3;
  color: #48586c;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.s-pending {
  color: #785415;
  background: #fff0c9;
}
.s-approved {
  color: #155f42;
  background: #e3f2e9;
}
.s-returned {
  color: #9a3d31;
  background: #ffebe6;
}
.s-open {
  color: #4a5970;
  background: #edf1f6;
}
.public {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f8f9f9;
}
.public-head {
  height: 83px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
}
.public-width {
  width: min(1280px, calc(100% - 10vw));
  margin: auto;
}
.public-head .public-width,
.public-foot .public-width {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.entry {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(305px, 0.76fr) minmax(0, 1.24fr);
  align-items: center;
  gap: clamp(40px, 6.5vw, 105px);
  padding: clamp(32px, 6vh, 76px) 0;
}
.login-column {
  padding-left: clamp(0px, 1.8vw, 32px);
}
.login-column h1 {
  font-size: clamp(2.65rem, 4.5vw, 4.45rem);
  line-height: 1.01;
  letter-spacing: -0.066em;
  margin: 19px 0 17px;
}
.login-column .intro {
  color: var(--secondary);
  max-width: 360px;
  font-size: 1rem;
}
.login-form {
  display: grid;
  gap: 16px;
  margin: 29px 0 19px;
  max-width: 400px;
}
.login-form .primary {
  min-height: 48px;
}
.label,
form label {
  display: grid;
  gap: 6px;
  font-size: 0.89rem;
  font-weight: 620;
}
.control {
  position: relative;
  display: flex;
  align-items: center;
}
.control > svg {
  position: absolute;
  left: 14px;
  color: #697785;
  pointer-events: none;
}
.control > input {
  padding-left: 42px;
}
.control .iconbtn {
  position: absolute;
  right: 4px;
}
.control:has(.iconbtn) input {
  padding-right: 42px;
}
input:not([type="checkbox"]),
textarea,
select {
  border: 1px solid #cbd2d8;
  background: white;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 0.94rem;
  font-weight: 400;
}
input::placeholder,
textarea::placeholder {
  color: #7b8793;
}
.control > input {
  padding-left: 42px;
  min-height: 47px;
}
textarea {
  resize: vertical;
  min-height: 92px;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23495b6d' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-size: 16px;
  background-position: right 10px center;
  background-repeat: no-repeat;
  padding-right: 30px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #798b9a;
}
.help-line {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--secondary);
}
.login-art {
  position: relative;
  isolation: isolate;
  border-radius: 15px;
  overflow: hidden;
  min-height: 470px;
  height: clamp(480px, 66vh, 735px);
  background: #a78972;
}
.login-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 53%;
}
.public-foot {
  padding: 19px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.81rem;
}
.public-foot span:last-child {
  display: flex;
  gap: 7px;
  align-items: center;
}
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 27px;
  background: #fff;
  border-right: 1px solid var(--line);
  height: 100dvh;
  position: sticky;
  top: 0;
  padding: 25px 15px 16px;
  z-index: 4;
}
.sidebar .brand {
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--line);
}
.navgroup {
  display: grid;
  gap: 3px;
}
.navlabel {
  padding: 0 13px 7px;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--muted);
}
.navitem {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 7px;
  font-size: 0.93rem;
  font-weight: 520;
  color: #49596b;
  gap: 12px;
}
.navitem:hover {
  background: #f3f5f6;
}
.navitem.active {
  background: #f9edcf;
  color: #42331a;
  font-weight: 660;
}
.navitem.active svg {
  color: #966b1f;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 5px;
}
.identity .names {
  min-width: 0;
  flex: 1;
}
.identity strong,
.identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity strong {
  font-size: 0.9rem;
}
.identity small {
  color: var(--muted);
  font-size: 0.77rem;
}
.avatar {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9edf0;
  color: #394d60;
  font-size: 0.84rem;
  font-weight: 700;
}
.work {
  min-width: 0;
}
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3.4vw, 56px);
  background: #fff;
}
.crumb,
.date-label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}
.crumb span,
.date-label {
  color: var(--muted);
}
.crumb i {
  color: #b2b9c2;
  font-style: normal;
}
.mobilemenu {
  display: none;
}
.content {
  max-width: 1520px;
  margin: auto;
  padding: clamp(24px, 3.2vw, 47px) clamp(18px, 3.4vw, 56px) 50px;
}
.pagehead,
.panelhead,
.rowhead,
.splitline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.pagehead {
  margin-bottom: 25px;
}
.pagehead p,
.panelhead p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.91rem;
}
.pagehead h1 {
  font-size: clamp(2rem, 3.4vw, 3.2rem);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.metric {
  padding: 17px 19px;
  display: grid;
  row-gap: 13px;
  text-align: left;
}
.metric:hover {
  border-color: #a9b6c0;
}
.metric > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--secondary);
  font-size: 0.87rem;
}
.metric strong {
  font-size: 1.9rem;
  letter-spacing: -0.06em;
  line-height: 1;
}
.dashgrid {
  display: grid;
  grid-template-columns: 1.03fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.panel {
  padding: 21px;
  min-width: 0;
}
.panelhead {
  margin-bottom: 16px;
}
.panelhead .textbtn {
  font-size: 0.82rem;
  white-space: nowrap;
}
.taskline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.taskline:first-child {
  border-top: 0;
}
.taskline:last-child {
  padding-bottom: 1px;
}
.miniicon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f6edda;
  color: #77561e;
}
.taskbody {
  flex: 1;
  min-width: 0;
}
.taskbody h3 {
  margin: 1px 0 5px;
}
.taskbody p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 5px 0 8px;
}
.taskbody .textbtn {
  font-size: 0.85rem;
}
.dashgrid .rp-atlas--compact {
  height: 225px;
}
.below {
  margin-top: 18px;
}
.listcontent {
  display: grid;
}
.empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.empty svg {
  display: block;
  margin: 0 auto 9px;
  color: #8c9ba6;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  align-items: center;
}
.filters select,
.filters input {
  width: auto;
  max-width: 100%;
  min-height: 39px;
  font-size: 0.9rem;
}
.filters input {
  flex: 1;
  max-width: 350px;
  min-width: 150px;
}
.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.record:first-child {
  border-top: 0;
}
.record:hover strong {
  color: #866125;
}
.record strong,
.record small {
  display: block;
}
.record strong {
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.record small {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.84rem;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.staffrow {
  display: flex;
  align-items: center;
  gap: 12px;
}
.staffrow .avatar {
  border-radius: 8px;
}
.member-dept {
  font-size: 0.85rem;
  color: var(--muted);
}
.paged {
  margin: 15px auto 0;
  display: flex;
}
.docgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.docgrid .panel p {
  font-size: 0.94rem;
  color: var(--secondary);
  margin-top: 10px;
}
.docgrid .panel h2 {
  font-size: 1.14rem;
}
.section-icon {
  color: #866123;
  margin-bottom: 12px;
}
.chart {
  display: flex;
  align-items: end;
  height: 160px;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 18px 0 6px;
  padding: 0 4px;
}
.bar {
  flex: 1;
  min-width: 1px;
  min-height: 2px;
  background: var(--gold);
  border-radius: 3px 3px 0 0;
}
.chartkey {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.81rem;
  color: var(--muted);
}
.stats-totals {
  display: flex;
  gap: 20px;
  margin: 10px 0;
  color: var(--secondary);
}
.stats-totals strong {
  color: var(--ink);
  font-size: 1.4rem;
}
#modal {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0;
  width: min(640px, calc(100vw - 28px));
  max-height: 90dvh;
  box-shadow: 0 18px 80px #1423333b;
  color: var(--ink);
  background: #fff;
}
#modal::backdrop {
  background: #1423337a;
}
#modal.wide {
  width: min(920px, calc(100vw - 28px));
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 22px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 3;
}
.modal-body {
  padding: 22px;
}
.formstack {
  display: grid;
  gap: 16px;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-hint {
  font-size: 0.87rem;
  color: var(--muted);
}
.form-error {
  font-size: 0.9rem;
  color: #9d342c;
  background: #fff2ef;
  border-radius: 5px;
  padding: 9px 11px;
}
.form-error:empty {
  display: none;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.stage input[type="file"] {
  font-size: 0.82rem;
}
.stage legend {
  padding: 0 6px;
  font-weight: 650;
  font-size: 0.94rem;
}
.stage .formgrid {
  align-items: end;
}
.stage label {
  font-size: 0.8rem;
}
.subtitle {
  font-size: 1rem;
  margin-top: 5px;
}
.detailgrid {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) 1.5fr;
  gap: 8px;
  font-size: 0.93rem;
}
.detailgrid dt {
  color: var(--muted);
}
.detailgrid dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.filegrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.filegrid img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f5f6f7;
}
.filegrid a {
  text-decoration: none;
}
.filegrid small {
  display: block;
  color: var(--muted);
}
.filegrid strong {
  font-size: 0.86rem;
}
.secret {
  font:
    600 1.2rem/1.4 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  background: #f3f5f7;
  padding: 15px;
  border-radius: 6px;
  user-select: all;
}
.checklabel {
  display: flex;
  gap: 8px;
  align-items: center;
}
.helpbox {
  padding: 14px;
  background: #f2f4f6;
  border-radius: 7px;
  font-size: 0.9rem;
}
.error-box {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  background: var(--navy);
  border-radius: 7px;
  color: white;
  padding: 10px 16px;
  box-shadow: 0 5px 20px #1527382e;
  z-index: 20;
  font-size: 0.91rem;
}
#notice:empty {
  display: none;
}
.shade {
  display: none;
}
.stack {
  display: grid;
  gap: 15px;
}
@media (min-width: 1600px) {
  .shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }
  .content {
    padding: 23px 21px 40px;
  }
  .panel {
    padding: 16px;
  }
  .metric {
    padding: 14px;
  }
  .metrics {
    gap: 8px;
  }
  .dashgrid {
    gap: 12px;
  }
  .entry {
    gap: 4vw;
  }
  .public-width {
    width: 92%;
  }
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 245px;
    transform: translateX(-105%);
    transition: transform 0.17s;
    overflow-y: auto;
  }
  .shell.menu-open .sidebar {
    transform: translateX(0);
  }
  .menu-open .shade {
    display: block;
    position: fixed;
    inset: 0;
    background: #13253661;
    z-index: 3;
  }
  .mobilemenu {
    display: inline-flex;
  }
  .topbar {
    height: 56px;
    padding: 0 15px;
  }
  .crumb {
    gap: 6px;
  }
  .date-label {
    font-size: 0.78rem;
  }
  .content {
    padding: 22px 18px 35px;
  }
  .entry {
    grid-template-columns: 0.93fr 1fr;
  }
  .login-art {
    min-height: 420px;
    height: 58vh;
  }
  .login-column h1 {
    font-size: 2.9rem;
  }
  .login-column {
    padding: 0;
  }
  .chart {
    gap: 2px;
  }
}
@media (max-width: 620px) {
  .public-width {
    width: calc(100% - 36px);
  }
  .public-head {
    height: 69px;
  }
  .brand img {
    width: 39px;
    height: 34px;
  }
  .brand {
    gap: 8px;
  }
  .entry {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 30px 0 23px;
    align-items: stretch;
    justify-content: center;
  }
  .login-column {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }
  .login-column h1 {
    font-size: 2.75rem;
    margin: 14px 0 12px;
  }
  .login-column h1 br {
    display: none;
  }
  .login-form {
    margin: 18px 0 12px;
    gap: 12px;
    max-width: none;
  }
  .login-art {
    height: 185px;
    min-height: 0;
    flex-shrink: 0;
  }
  .public-foot {
    padding: 14px 0;
  }
  .public-foot span:last-child {
    display: none;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashgrid,
  .docgrid {
    grid-template-columns: 1fr;
  }
  .pagehead {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
  }
  .pagehead h1 {
    font-size: 2rem;
  }
  .date-label svg {
    display: none;
  }
  .metric {
    row-gap: 7px;
  }
  .metric strong {
    font-size: 1.65rem;
  }
  .member-dept {
    display: none;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-head {
    padding: 12px 16px;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .docgrid .panel {
    padding: 18px;
  }
  .panelhead {
    gap: 8px;
  }
  .date-label {
    max-width: 43%;
    text-align: right;
  }
  .modal-head h2 {
    font-size: 1.15rem;
  }
  .filters select {
    flex: 1;
  }
  .stage {
    margin: 0;
  }
  .public-foot small {
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 800px) {
  .shell:not(.menu-open) .sidebar {
    visibility: hidden;
    pointer-events: none;
  }
  .shell.menu-open .sidebar {
    visibility: visible;
  }
}

/* Phone-only navigation stays out of desktop and tablet layouts. */
.phone-tabs,
.phone-identity {
  display: none;
}
.stage-preview {
  display: block;
  width: min(100%, 360px);
  max-height: 170px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
}
.stage-preview[hidden],
.chart-picker {
  display: none;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.sidebar {
  overflow-y: auto;
}
.formstack,
.formgrid,
.formstack > *,
.formgrid > *,
fieldset.stage {
  min-width: 0;
}
@media (max-width: 700px),
  (max-width: 950px) and (max-height: 500px) and (pointer: coarse) {
  :root {
    --tab-height: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  .shell {
    display: block;
  }
  .shell .sidebar,
  .shell .shade,
  .topbar > .crumb,
  .topbar > .date-label {
    display: none;
  }
  .topbar {
    height: auto;
    min-height: 57px;
    padding: calc(6px + env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right)) 6px
      max(16px, env(safe-area-inset-left));
  }
  .phone-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }
  .phone-identity .brand img {
    width: 33px;
    height: 32px;
  }
  .phone-identity .brand span {
    display: none;
  }
  .phone-identity .avatar {
    width: 44px;
    height: 44px;
    flex: none;
  }
  .phone-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 2px env(safe-area-inset-right) env(safe-area-inset-bottom)
      env(safe-area-inset-left);
    height: var(--tab-height);
  }
  .phone-tabs a,
  .phone-tabs button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 2px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 550;
    line-height: 1.25;
  }
  .phone-tabs :is([aria-current="page"], .current) {
    color: #6e4916;
    font-weight: 700;
  }
  .phone-tabs :is([aria-current="page"], .current) svg {
    box-sizing: content-box;
    background: var(--goldbg);
    border-radius: 12px;
    padding: 3px 12px;
    margin: -3px -12px;
  }
  .phone-sections {
    display: grid;
    gap: 4px;
  }
  .phone-sections .navitem {
    min-height: 49px;
  }
  .work > .content {
    padding: 20px max(14px, env(safe-area-inset-right))
      calc(var(--tab-height) + 24px) max(14px, env(safe-area-inset-left));
  }
  .public-width {
    max-width: 100%;
  }
  .public-head {
    padding-top: env(safe-area-inset-top);
  }
  .pagehead .actions,
  .pagehead .btn {
    width: 100%;
  }
  .pagehead h1 {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
  }
  #content[data-page="home"] {
    display: grid;
    gap: 14px;
  }
  #content[data-page="home"] > .pagehead {
    margin: 0;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .docgrid,
  .dashgrid {
    grid-template-columns: 1fr;
  }
  .metric {
    min-width: 0;
    padding: 13px 12px;
    gap: 8px;
  }
  .metric > span {
    font-size: 0.85rem;
    gap: 6px;
  }
  .btn,
  .iconbtn,
  .textbtn,
  .navitem {
    min-height: 44px;
  }
  .iconbtn {
    min-width: 44px;
  }
  .btn {
    white-space: normal;
  }
  .panelhead {
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .panelhead h2 {
    flex: 1 1 8rem;
    font-size: 1.16rem;
  }
  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .filters select,
  .filters input {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .filters :only-child,
  .filters input[type="search"] {
    grid-column: 1/-1;
  }
  .filters label:only-child {
    display: grid;
    gap: 5px;
  }
  input:not([type="checkbox"]),
  select,
  textarea,
  .filters select,
  .filters input,
  .stage input[type="file"] {
    font-size: 1rem;
    min-height: 44px;
  }
  .filters:has(#person-search) select:only-of-type {
    grid-column: 1/-1;
  }
  #people-list .record {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
  #people-list .member-dept {
    display: block;
    margin-left: 49px;
    font-size: 0.8rem;
  }
  .staffrow > span:last-child {
    min-width: 0;
  }
  #records-list .record,
  .below > .record {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .record > .badge {
    justify-self: start;
  }
  .chart {
    gap: 1px;
  }
  .chart-picker {
    display: grid;
    gap: 3px;
    color: var(--secondary);
    font-size: 0.875rem;
    margin-top: 8px;
  }
  .chart-picker input[type="range"] {
    padding: 0;
    border: 0;
    accent-color: var(--navy);
    min-height: 44px;
  }
  .bar.selected {
    background: var(--navy);
  }
  #modal,
  #modal.wide {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    max-height: 100svh;
    margin: auto 0 0;
    border: 0;
    border-radius: 16px 16px 0 0;
    overscroll-behavior: contain;
  }
  #modal:has(.formstack),
  #modal.wide {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .modal-head {
    min-height: 56px;
    padding: calc(6px + env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right)) 6px
      max(16px, env(safe-area-inset-left));
  }
  .modal-head .iconbtn {
    flex-shrink: 0;
  }
  .modal-body {
    padding: 16px max(16px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
  .form-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 106px), 1fr));
  }
  .formgrid {
    grid-template-columns: minmax(0, 1fr);
  }
  .detailgrid {
    grid-template-columns: minmax(80px, 0.6fr) minmax(0, 1.4fr);
    margin: 0;
  }
  .modal-body .inline {
    overflow-wrap: anywhere;
  }
  .filegrid {
    gap: 8px;
  }
  #notice {
    bottom: calc(var(--tab-height) + 10px);
    width: max-content;
    max-width: calc(100% - 24px);
  }
}
@media (max-width: 370px) {
  .filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel,
  .docgrid .panel {
    padding: 13px;
  }
  .taskline {
    gap: 8px;
  }
}

.day-tabs {
  display: inline-flex;
  background: #eaf0f1;
  border-radius: 9px;
  padding: 4px;
  gap: 3px;
  margin-bottom: 10px;
}
.day-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 16px;
  color: var(--secondary);
  border-radius: 7px;
}
.day-tabs button[aria-pressed="true"] {
  color: var(--ink);
  background: white;
  box-shadow: 0 1px 4px #1c314a21;
}
.day-tabs small,
.job-time small,
.job-main small,
.ranking small {
  display: block;
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--muted);
}
.shift-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  margin: 0 0 20px;
}
.shift-toolbar .day-tabs {
  margin: 0;
}
.shift-hint {
  font-size: 0.9rem;
  color: var(--secondary);
}
.jobs-panel {
  padding-block: 0;
}
.schedule-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.schedule-head h2,
.today-work h2 {
  font-size: 1.22rem;
}
.schedule-head select {
  width: auto;
  max-width: 100%;
  padding: 6px 32px 6px 10px;
  min-height: 40px;
  font-size: 0.9rem;
}
.job-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(105px, auto) 16px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 0;
  text-align: left;
  border-top: 1px solid var(--line);
  line-height: 1.4;
}
.job-row:first-child {
  border-top: 0;
}
.job-row:hover,
.job-row:focus-visible {
  background: #f5f7f9;
}
.job-row > svg {
  color: #778391;
  justify-self: end;
}
.job-time {
  align-self: start;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 0.96rem;
  font-weight: 630;
}
.job-main strong,
.ranking strong {
  overflow-wrap: anywhere;
}
.job-main strong {
  font-weight: 620;
}
.job-main small {
  margin-top: 3px;
  line-height: 1.4;
}
.job-spaces {
  font-size: 0.85rem;
  color: var(--secondary);
  font-weight: 550;
}
.job-spaces small,
.home-next small {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 450;
  margin-top: 2px;
}
.job-spaces small.my-status {
  color: var(--green);
  font-weight: 600;
}
.crew-settings {
  margin-top: 14px;
}
.job-sheet {
  display: grid;
  gap: 16px;
}
.job-meta,
.job-site h3,
.job-foot {
  display: flex;
  gap: 7px;
  align-items: center;
}
.job-meta {
  font-size: 0.93rem;
  color: var(--secondary);
  flex-wrap: wrap;
}
.job-meta svg,
.job-site h3 svg {
  flex: none;
}
.job-site h3 {
  font-weight: 600;
  margin-bottom: 9px;
}
.job-foot {
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.enrollment,
.home-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.enrollment .form-hint {
  margin-top: 4px;
}
.job-sheet .team-list {
  margin: 0;
}
.today-work {
  margin-bottom: 18px;
}
.today-work .panelhead {
  margin-bottom: 10px;
}
.home-next {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
.home-next strong {
  font-size: 0.93rem;
  font-weight: 600;
}
.team-list {
  padding-inline-start: 20px;
  margin: 8px 0 0;
}
.team-list li {
  padding: 3px 0;
  overflow-wrap: anywhere;
}
.panel details {
  border-top: 1px solid var(--line);
  padding-block: 8px;
}
.panel summary {
  cursor: pointer;
  padding: 6px 0;
}
.ranking {
  padding: 0;
  list-style: none;
  margin: 10px 0 0;
}
.ranking li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.place-rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #edf1f4;
  font-weight: 650;
}
.ranking li[data-top="true"] .place-rank {
  background: var(--goldbg);
  color: #6e4916;
}
.upload-item {
  display: grid;
  align-items: center;
  grid-template-columns: 64px minmax(0, 1fr) 44px;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.upload-item img {
  width: 64px;
  height: 46px;
  object-fit: cover;
  border-radius: 5px;
}
.upload-item span {
  overflow-wrap: anywhere;
  font-size: 0.875rem;
}
@media (max-width: 700px) {
  .day-tabs {
    display: flex;
  }
  .day-tabs button {
    flex: 1;
    flex-direction: column;
    gap: 0;
  }
  .shift-toolbar {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
  }
  .schedule-head {
    padding: 9px 0;
    align-items: center;
  }
  .schedule-head h2 {
    font-size: 1.05rem;
  }
  .schedule-head select {
    font-size: 1rem;
    min-height: 44px;
  }
  .job-row {
    grid-template-columns: 43px minmax(0, 1fr) 12px;
    gap: 4px 9px;
    padding: 13px 0;
  }
  .job-time {
    font-size: 0.9rem;
  }
  .job-row > svg {
    grid-column: 3;
    grid-row: 1/3;
    align-self: center;
  }
  .job-spaces {
    grid-column: 2;
    display: flex;
    gap: 2px 6px;
    flex-wrap: wrap;
    align-items: baseline;
    font-size: 0.77rem;
  }
  .job-spaces small {
    font-size: inherit;
    margin: 0;
  }
  .job-spaces small::before {
    content: "· ";
  }
  .job-sheet {
    gap: 13px;
  }
  .enrollment .actions:has(.primary),
  .enrollment .actions .primary {
    width: 100%;
  }
  .home-next {
    align-items: flex-start;
  }
  .today-work {
    margin-bottom: 0;
  }
}
