:root {
  color-scheme: dark;
  --canvas: #0D0F14;
  --sidebar: var(--canvas);
  --surface: #131720;
  --raised: #191F2B;
  --line: #1E2535;
  --field-line: #46546B;
  --ink: #E8EDF5;
  --muted: #A9B5C8;
  --accent: #00D4E8;
  --accent-hover: #62E9F5;
  --accent-soft: #123039;
  --amber: #F5A623;
  --amber-soft: #382A16;
  --danger: #FF9C91;
  --danger-soft: #381F25;
  --shadow: 0 2px 5px #00000033;
  font-family: Inter,"Segoe UI",system-ui,sans-serif;
  font-size: 100%;
  background: var(--canvas);
  color: var(--ink);
}

*,*::before,*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

body:has(dialog[open]) {
  overflow: hidden;
}

button,input,select,textarea {
  font: inherit;
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1,h2,h3,p {
  margin: 0;
}

button {
  color: inherit;
}

svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: none;
}

.layout {
  display: grid;
  grid-template-columns: 224px minmax(0,1fr);
  min-height: 100dvh;
}

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 27px 17px 18px;
  background: var(--sidebar);
  color: var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  margin-bottom: 47px;
  width: max-content;
}

.brand strong {
  font-size: 1.15rem;
  display: block;
  line-height: 1.22;
  letter-spacing: .025em;
}

.brand small,.side-bottom small {
  display: block;
  font-size: .81rem;
  color: var(--muted);
  margin-top: 4px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: var(--sidebar);
}

.brand-mark svg {
  height: 23px;
  width: 23px;
  fill: currentColor;
  stroke-width: 1.4;
}

.nav-caption {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-weight: 700;
  font-size: .75rem;
  padding: 0 11px;
  margin-bottom: 13px;
}

.nav-link {
  min-height: 45px;
  padding: 10px 11px;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 550;
  margin-bottom: 5px;
}

.nav-link:hover {
  background: var(--raised);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.nav-link svg {
  width: 18px;
  height: 18px;
}

.side-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 17px 3px 1px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.side-bottom strong {
  font-size: .85rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-bottom>span:last-child {
  min-width: 0;
}

.avatar {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .73rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: none;
}

.side-bottom .avatar {
  width: 34px;
  height: 34px;
  background: var(--accent-soft);
  color: var(--accent);
}

.topbar {
  min-height: 65px;
  padding: 10px clamp(20px,3vw,40px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.breadcrumb,.top-actions {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: .875rem;
}

.crumb-company,.crumb-slash {
  color: var(--muted);
}

.top-actions {
  gap: 9px;
}

.today {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.today svg {
  width: 16px;
  height: 16px;
}

.content {
  max-width: 1530px;
  margin: auto;
  padding: 28px clamp(20px,3vw,40px) 36px;
}

.loading {
  padding: 20px 0;
  color: var(--muted);
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  min-height: 39px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: .875rem;
  font-weight: 680;
  line-height: 1.2;
  white-space: nowrap;
}

.btn svg {
  height: 17px;
  width: 17px;
}

.btn-primary {
  color: var(--canvas);
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-light {
  background: var(--surface);
  border-color: var(--line);
}

.btn-light:hover,.btn-quiet:hover {
  background: var(--raised);
}

.btn-quiet {
  color: var(--accent);
}

.btn-icon {
  padding: 7px;
  min-width: 37px;
  min-height: 37px;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 10px;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 179px;
  background: var(--surface);
  border-radius: 14px;
  padding: 25px 29px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero .eyebrow {
  color: var(--accent);
  margin-bottom: 8px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 760;
  font-size: .75rem;
}

.hero h1,.page-heading h1 {
  font-size: clamp(1.8rem,3.4vw,2.45rem);
  font-weight: 770;
  letter-spacing: -.045em;
  line-height: 1.13;
}

.hero p {
  margin-top: 9px;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
}

.hero .btn {
  background: var(--accent);
  color: var(--canvas);
  border-color: var(--accent);
  margin-top: 17px;
}

.hero .btn:hover {
  background: var(--accent-hover);
}

.hero-art {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 43%;
  overflow: hidden;
  background: radial-gradient(ellipse at 80% 52%,#123A46 0%,transparent 65%),linear-gradient(100deg,transparent,#12303974);
  mask-image: linear-gradient(90deg,transparent 0%,black 38%);
}

.hero-grid {
  position: absolute;
  inset: -45% -12% -54% 5%;
  transform: perspective(390px) rotateX(37deg) rotateZ(-24deg);
  background: repeating-linear-gradient(#00D4E82C 0 1px,transparent 1px 26px),repeating-linear-gradient(90deg,#00D4E82C 0 1px,transparent 1px 26px);
  mask-image: radial-gradient(ellipse at 70% 51%,black 18%,transparent 71%);
}

.hero-ring {
  position: absolute;
  right: 11%;
  top: 50%;
  width: 145px;
  height: 145px;
  border: 1px solid #00D4E878;
  border-radius: 32px;
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 0 0 0 17px #00D4E80B,0 0 0 33px #00D4E80D,inset 0 0 36px #00D4E817;
}

.hero-ring::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid #00D4E83B;
  border-radius: 20px;
}

.hero-bolt {
  position: absolute;
  right: calc(11% + 41px);
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
}

.hero-bolt svg {
  width: 64px;
  height: 64px;
  stroke-width: 1.05;
  fill: #00D4E818;
  filter: drop-shadow(0 0 18px #00D4E894);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 13px;
  margin: 19px 0 22px;
}

.stat {
  min-width: 0;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 11px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  box-shadow: var(--shadow);
}

.stat:hover {
  border-color: var(--accent);
  background: var(--raised);
}

.stat-icon,.order-icon {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  flex: none;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.stat-icon svg,.order-icon svg {
  width: 19px;
  height: 19px;
}

.tone-green {
  background: #16332A;
  color: #79DEAC;
}

.tone-blue {
  background: #1B2B48;
  color: #A7C9FF;
}

.tone-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tone-violet {
  background: #2C2342;
  color: #D6BFFF;
}

.stat-info {
  display: block;
  min-width: 0;
}

.stat-number {
  display: block;
  font-size: 1.53rem;
  line-height: 1.05;
  font-weight: 790;
  letter-spacing: -.045em;
}

.stat-name {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.25;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(253px,29%);
  gap: 17px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 17px 13px;
}

.panel-header h2 {
  font-weight: 750;
  font-size: 1.13rem;
  letter-spacing: -.016em;
}

.panel-header p {
  color: var(--muted);
  font-size: .86rem;
  margin-top: 4px;
}

.tool-row {
  display: flex;
  gap: 8px;
  padding: 0 17px 13px;
}

.search {
  position: relative;
  min-width: 0;
  flex: 1;
  max-width: 420px;
}

.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 17px;
  width: 17px;
  color: var(--muted);
  pointer-events: none;
}

.field,.search input,select {
  min-height: 39px;
  border: 1px solid var(--field-line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--canvas);
  font-size: .9rem;
}

input::placeholder,textarea::placeholder {
  color: var(--muted);
}

.search input {
  padding: 7px 9px 7px 34px;
  width: 100%;
}

.field {
  padding: 8px 10px;
  width: 100%;
}

select {
  appearance: none;
  background: var(--canvas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23A9B5C8' stroke-width='1.7'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 9px center / 17px;
  padding: 7px 30px 7px 10px;
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
}

.order-table thead {
  background: var(--raised);
  border-block: 1px solid var(--line);
}

.order-table th {
  font-size: .79rem;
  color: var(--muted);
  padding: 9px 8px;
  font-weight: 700;
}

.order-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: .88rem;
}

.order-table th:first-child,.order-table td:first-child {
  padding-left: 17px;
  width: auto;
}

.order-table th:nth-child(2) {
  width: 116px;
}

.order-table th:nth-child(3) {
  width: 97px;
}

.order-table th:nth-child(4) {
  width: 48px;
}

.order-table th:last-child,.order-table td:last-child {
  padding-right: 10px;
}

.order-table tbody tr:hover {
  background: var(--raised);
}

.order-title {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  width: 100%;
  font: inherit;
}

.order-title:hover strong {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.order-title>span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-icon {
  height: 34px;
  width: 34px;
  border-radius: 8px;
}

.order-icon svg {
  height: 17px;
  width: 17px;
}

.order-title strong,.entry-title {
  display: block;
  font-size: .9rem;
  font-weight: 710;
  line-height: 1.27;
}

.order-title small,.entry-meta {
  display: block;
  color: var(--muted);
  font-size: .79rem;
  margin-top: 4px;
  line-height: 1.35;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 30px;
  padding: 4px 8px;
  line-height: 1.1;
  min-height: 24px;
  white-space: nowrap;
  font-size: .81rem;
  font-weight: 670;
}

.tag::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag-plan {
  background: #252E3D;
  color: #C2CEE0;
}

.tag-work {
  background: #1B2B48;
  color: #A7C9FF;
}

.tag-review {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag-done {
  background: #16332A;
  color: #79DEAC;
}

.tag-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.date-cell {
  white-space: nowrap;
  color: var(--ink);
}

.late {
  color: var(--danger);
  font-weight: 650;
}

.table-foot {
  min-height: 43px;
  padding: 11px 17px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: .83rem;
}

.updates .panel-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.updates .panel-header .btn {
  margin: -4px -4px -4px 0;
}

.feed-list,.deadline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-item {
  border-bottom: 1px solid var(--line);
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-button {
  padding: 13px 14px;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 0;
  background: none;
  text-align: left;
}

.feed-button:hover {
  background: var(--raised);
}

.feed-button>span:last-child {
  min-width: 0;
  flex: 1;
}

.feed-author {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.feed-author strong {
  font-size: .84rem;
  overflow-wrap: anywhere;
}

.feed-author time {
  font-size: .75rem;
  color: var(--muted);
}

.feed-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .86rem;
  margin: 4px 0 5px;
  line-height: 1.39;
  overflow-wrap: anywhere;
}

.feed-project {
  display: block;
  color: var(--accent);
  font-weight: 650;
  font-size: .77rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel-foot {
  border-top: 1px solid var(--line);
  padding: 8px 12px;
}

.mode-note {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 17px;
  font-size: .83rem;
  color: var(--muted);
}

.mode-note>svg {
  height: 16px;
  width: 16px;
}

.mode-note .btn {
  padding-inline: 6px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.page-heading p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.empty {
  padding: 27px 17px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.empty strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.empty .btn {
  margin-top: 12px;
}

.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #653743;
  border-radius: 9px;
  padding: 11px 13px;
  margin-bottom: 13px;
  line-height: 1.4;
}

.empty .error,.form-error {
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(235px,32%) minmax(0,1fr);
  gap: 16px;
  align-items: start;
}

.project-pick {
  padding: 12px 15px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  width: 100%;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
}

.project-pick:hover,.project-pick[aria-current="true"] {
  background: var(--accent-soft);
}

.project-pick:last-child {
  border-radius: 0 0 12px 12px;
}

.project-pick span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.thread-header {
  border-bottom: 1px solid var(--line);
}

.thread {
  padding: 13px 17px;
  min-height: 200px;
  max-height: min(60vh,530px);
  overflow: auto;
  overscroll-behavior: contain;
}

.chat-line {
  display: flex;
  gap: 10px;
  margin: 0 0 15px;
}

.chat-line:last-child {
  margin-bottom: 0;
}

.chat-content {
  max-width: 90%;
  min-width: 0;
}

.chat-line.mine .chat-content {
  margin-left: auto;
}

.chat-line.mine .chat-meta {
  justify-content: flex-end;
}

.chat-meta {
  font-size: .81rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.chat-meta strong {
  color: var(--ink);
}

.bubble {
  padding: 9px 11px;
  border-radius: 2px 10px 10px;
  background: var(--raised);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-size: .93rem;
}

.mine .bubble {
  background: var(--accent-soft);
  border-radius: 10px 2px 10px 10px;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 12px 15px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.composer textarea {
  min-height: 44px;
  max-height: 160px;
  resize: vertical;
  flex: 1 1 190px;
  line-height: 1.4;
}

.composer .form-error {
  flex: 1 0 100%;
}

.deadline-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 17px;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
}

.deadline-item:hover {
  background: var(--raised);
}

.deadline-date {
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 65px;
  min-height: 49px;
  background: var(--amber-soft);
  border-radius: 8px;
  color: var(--amber);
  font-weight: 750;
}

.deadline-date.late {
  background: var(--danger-soft);
  color: var(--danger);
}

.deadline-date small {
  font-size: .72rem;
}

.deadline-detail {
  flex: 1;
  overflow-wrap: anywhere;
}

.deadline-header {
  padding: 14px 17px;
  background: var(--raised);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
}

.deadline-header h3 {
  font-size: inherit;
}

.deadline-item .tag {
  margin-left: auto;
}

.toast {
  position: fixed;
  z-index: 5;
  bottom: 20px;
  right: 20px;
  max-width: min(370px,calc(100vw - 40px));
  background: var(--accent-soft);
  color: var(--ink);
  padding: 11px 15px;
  border-radius: 9px;
  box-shadow: 0 5px 24px #00000066;
  font-size: .9rem;
}

.toast[hidden],[hidden] {
  display: none!important;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  width: min(560px,calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  box-shadow: 0 12px 60px #00000099;
}

dialog::backdrop {
  background: #05070BC2;
}

.dialog-head {
  padding: 17px 20px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 1.27rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dialog-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: .88rem;
}

.dialog-body {
  padding: 17px 20px;
}

.dialog-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.form-grid,.detail-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 13px;
}

.form-grid label {
  display: grid;
  gap: 5px;
  font-size: .86rem;
  font-weight: 690;
}

.form-grid .wide,.form-grid .form-error {
  grid-column: 1/-1;
}

.form-grid textarea {
  resize: vertical;
  min-height: 78px;
}

.detail-grid {
  margin: 0;
}

.detail-grid dt {
  color: var(--muted);
  font-size: .83rem;
}

.detail-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.detail-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 16px;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media(max-width:1170px) {
  .layout {
    grid-template-columns: 192px minmax(0,1fr);
  }
  .content {
    padding-inline: 24px;
  }
  .topbar {
    padding-inline: 24px;
  }
  .order-table th:nth-child(3) {
    width: 84px;
  }
  .order-table th:nth-child(4) {
    width: 41px;
  }
  .dashboard {
    grid-template-columns: minmax(0,1fr) minmax(215px,27%);
    gap: 12px;
  }
}

@media(max-width:970px) {
  .layout {
    grid-template-columns: 72px minmax(0,1fr);
  }
  .side {
    padding: 22px 9px 16px;
  }
  .brand {
    padding: 0;
    margin-inline: auto;
    margin-bottom: 28px;
  }
  .brand>span:last-child,.nav-caption,.nav-link span,.side-bottom>span:last-child {
    display: none;
  }
  .nav-link {
    justify-content: center;
    padding: 10px;
  }
  .nav-link svg {
    width: 21px;
    height: 21px;
  }
  .side-bottom {
    justify-content: center;
  }
  .stat {
    gap: 8px;
    padding: 11px;
  }
  .stat-icon {
    width: 35px;
    height: 35px;
  }
}

@media(max-width:795px) {
  .dashboard {
    grid-template-columns: minmax(0,1fr);
  }
  .updates .feed-list {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .updates .feed-item {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .updates .feed-item:last-child {
    border-right: 0;
  }
  .topbar {
    padding-inline: 19px;
  }
  .content {
    padding-inline: 19px;
  }
}

@media(max-width:590px) {
  .layout {
    display: block;
  }
  .side {
    position: fixed;
    z-index: 4;
    inset: auto 0 0;
    height: auto;
    min-height: 61px;
    padding: 4px 6px max(4px,env(safe-area-inset-bottom));
    box-shadow: 0 -3px 13px #00000066;
  }
  .brand,.side-bottom {
    display: none;
  }
  .side nav {
    display: flex;
    justify-content: space-around;
    gap: 2px;
  }
  .nav-link {
    width: auto;
    flex: 1;
    min-width: 0;
    min-height: 48px;
    flex-direction: column;
    gap: 3px;
    padding: 5px 2px;
    margin: 0;
    font-size: .72rem;
  }
  .nav-link span {
    display: block;
  }
  .nav-link svg {
    width: 18px;
    height: 18px;
  }
  .main {
    padding-bottom: 62px;
  }
  .topbar {
    min-height: 54px;
    padding-inline: 13px;
  }
  .breadcrumb,.top-actions {
    gap: 6px;
  }
  .today {
    display: none;
  }
  .content {
    padding: 15px 12px 22px;
  }
  .hero {
    min-height: 158px;
    padding: 17px;
  }
  .hero p {
    max-width: 275px;
    font-size: .89rem;
  }
  .hero-art {
    inset-inline-start: 38%;
    opacity: .64;
  }
  .hero-ring {
    right: 9%;
    width: 97px;
    height: 97px;
  }
  .hero-bolt {
    right: calc(9% + 25px);
  }
  .hero-bolt svg {
    width: 47px;
    height: 47px;
  }
  .stats {
    gap: 8px;
    grid-template-columns: repeat(2,minmax(0,1fr));
    margin: 12px 0 14px;
  }
  .stat {
    padding: 9px;
  }
  .stat-name {
    font-size: .79rem;
  }
  .stat-number {
    font-size: 1.27rem;
  }
  .panel-header {
    padding-inline: 11px;
  }
  .tool-row {
    padding-inline: 11px;
  }
  .order-table th:first-child,.order-table td:first-child {
    padding-left: 10px;
  }
  .order-table td,.order-table th {
    padding-inline: 4px;
  }
  .order-table th:nth-child(2) {
    width: 92px;
  }
  .order-table th:nth-child(3) {
    width: 64px;
  }
  .order-table th:nth-child(4) {
    width: 35px;
  }
  .order-table .btn-icon {
    min-width: 29px;
    padding-inline: 3px;
  }
  .order-table .order-icon {
    display: none;
  }
  .tag {
    padding: 4px 6px;
    font-size: .73rem;
    gap: 4px;
  }
  .date-cell {
    font-size: .78rem!important;
  }
  .order-title strong {
    font-size: .84rem;
  }
  .order-title small {
    font-size: .74rem;
  }
  .updates .feed-list {
    display: block;
  }
  .updates .feed-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .page-heading h1 {
    font-size: 1.56rem;
  }
  .page-heading p {
    font-size: .88rem;
  }
  .page-heading .btn {
    padding-inline: 8px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .thread {
    min-height: 140px;
    max-height: 55vh;
  }
  .project-list {
    max-height: 218px;
    overflow: auto;
  }
  .toast {
    bottom: 72px;
    right: 12px;
  }
  .deadline-item {
    padding-inline: 11px;
    gap: 8px;
  }
  .deadline-date {
    min-width: 48px;
  }
  .form-grid {
    gap: 10px;
  }
  .dialog-head,.dialog-body,.dialog-foot {
    padding-inline: 13px;
  }
}

@media(prefers-reduced-motion:no-preference) {
  .btn,.nav-link,.stat {
    transition: background-color .15s,border-color .15s;
  }
}

.extra-stack,.extra-list,.extra-card,.extra-section {
  display: grid;
  gap: 12px;
}

.extra-stack {
  margin-top: 20px;
}

.extra-code,.extra-card-head,.extra-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.extra-code code {
  color: var(--accent);
  user-select: all;
}

.extra-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}

.extra-form {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}

.extra-form .wide {
  grid-column: 1 / -1;
}

.extra-form label,.extra-inline label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.extra-form input[type="file"] {
  min-height: 44px;
  padding: 6px;
}

.extra-form input::file-selector-button {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--field-line);
  border-radius: 5px;
  padding: 6px;
  margin-inline-end: 6px;
}

.extra-help,.photo-grid small {
  color: var(--muted);
  font-size: .86rem;
}

.document-errors {
  margin: 0;
  padding-inline-start: 1.25rem;
  overflow-wrap: anywhere;
}

.worker-orders,.management-list,.document-history ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.worker-orders,.management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,19rem),1fr));
  gap: 14px;
}

.worker-order {
  gap: 12px;
  padding: 16px;
}

.worker-order h2,.worker-qualification-reminders h2,.management-card h2,.management-drive h2 {
  margin: 0;
  font-size: 1.08rem;
}

.worker-order h2 a {
  color: var(--ink);
}

.worker-search {
  max-width: 32rem;
  margin-bottom: 14px;
}

.worker-qualification-reminders {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.worker-qualification-reminder {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  overflow-wrap: anywhere;
}

.worker-qualification-reminder .qualification-deadline {
  margin-top: 5px;
}

.worker-actions {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}

.worker-actions .btn {
  min-height: 48px;
  white-space: normal;
  text-align: center;
}

.worker-closed,.management-drive {
  margin-top: 16px;
}

.worker-closed summary,.document-history summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 10px;
}

.management-date {
  margin: 0 0 12px;
}

.management-card,.management-drive,.management-list,.document-history ul {
  display: grid;
  gap: 12px;
}

.management-card {
  align-content: start;
}

.management-count {
  color: var(--accent);
  margin-inline-start: 4px;
}

.management-list small {
  display: block;
  color: var(--muted);
}

.management-expiries li {
  display: grid;
  gap: 5px;
}

.management-expiries time {
  color: var(--muted);
  font-size: .9rem;
}

.management-expiries .qualification-overdue,.worker-qualification-reminder.qualification-overdue {
  padding: 8px 10px;
  border-inline-start: 3px solid var(--danger);
  border-radius: 6px;
  background: var(--danger-soft);
}

.qualification-deadline {
  color: var(--muted);
  font-size: .9rem;
}

.qualification-deadline-form label {
  flex: 0 1 12rem;
}

.extra-card.evidence-selected {
  border-color: var(--accent);
  scroll-margin-block: 6rem;
}

.qualification-checklist h3 {
  margin: 0;
}

.qualification-worker-summary {
  gap: 6px;
}

.qualification-overview-heading {
  justify-content: space-between;
}

.qualification-overview-heading label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.qualification-overview-filters {
  align-items: end;
  max-width: 100%;
}

.qualification-overview-filters label {
  flex: 1 1 auto;
}

.qualification-worker-summary > .extra-card-head {
  justify-content: space-between;
}

.qualification-worker-summary summary {
  color: var(--accent);
}

.qualification-catalog-worker {
  display: grid;
  gap: 6px;
  max-width: 28rem;
}

.drive-orders {
  margin-top: 12px;
}

.diary-draft {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.current-drawings {
  padding-bottom: 8px;
}

.user-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr));
  gap: 12px;
}

.user-controls label {
  display: grid;
  gap: 5px;
}

[data-document-progress] {
  overflow-wrap: anywhere;
}

.extra-note,.extra-form .error {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.extra-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  overflow-wrap: anywhere;
}

.extra-inline {
  align-items: end;
}

.extra-inline label {
  flex: 1 1 180px;
}

.extra-inline select {
  max-width: 100%;
  width: 100%;
}

.extra-inline .error {
  flex-basis: 100%;
}

.extra-list,.photo-grid {
  padding: 0;
  margin: 0;
  list-style: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(130px,100%),1fr));
  gap: 10px;
}

.photo-grid figure {
  margin: 0;
  overflow-wrap: anywhere;
}

.photo-grid figcaption {
  display: grid;
  gap: 3px;
  margin-top: 5px;
}

.photo-grid img,.inbox-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--raised);
}

.inbox-photo {
  max-width: 220px;
}

.extra-page {
  padding: 16px;
}

@media (max-width: 540px) {
  .extra-form {
    grid-template-columns: minmax(0,1fr);
  }

  .extra-inline .btn,.extra-form .btn {
    min-height: 44px;
  }
}

.material-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.material-page-actions .btn {
  min-height: 44px;
}

.record-choices,.record-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
}

.record-choices label {
  display: flex;
  align-items: center;
  min-height: 40px;
  overflow-wrap: anywhere;
}

.record-choices input {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

#supplier-text {
  resize: vertical;
}

@media (max-width: 540px) {
  .material-page-actions {
    width: 100%;
  }

  .material-page-actions .btn {
    flex: 1 1 auto;
  }
}

.account-panel {
  max-width: 700px;
  overflow-wrap: anywhere;
}

.account-panel label,#worker-list label {
  display: grid;
  gap: 5px;
}

#worker-list .record-choices label {
  display: flex;
}

#standalone-record .extra-section {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.mobile-menu {
  display: none;
}

.side nav {
  min-height: 0;
  overflow-y: auto;
}

.evidence-form {
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
}

.evidence-form summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 10px;
  font-weight: 650;
}

.evidence-form form,.evidence-form .extra-list {
  margin-top: 8px;
}

.extra-form .evidence-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.evidence-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.help-list {
  display: grid;
  gap: 8px;
  padding-inline-start: 1.1rem;
}

.drive-counts {
  margin-top: 12px;
}

@media (max-width: 590px) {
  .side nav {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    max-height: min(54dvh,350px);
  }

  .side nav[data-expanded="false"] {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }

  .side nav[data-expanded="false"] .nav-secondary {
    display: none;
  }

  .side nav .mobile-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding-inline: 2px;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    white-space: normal;
  }

  .main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}
