:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #eef3f9;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d9e2ec;
  --line-strong: #c8d5e4;
  --text: #223246;
  --muted: #66778a;
  --accent: #1976ff;
  --accent-soft: #eaf2ff;
  --success: #169b67;
  --success-soft: #e9f8f1;
  --danger: #d24d44;
  --danger-soft: #fff1ef;
  --warning: #c97818;
  --warning-soft: #fff6e8;
  --shadow: 0 14px 32px rgba(34, 60, 92, 0.08);
  --shadow-sm: 0 6px 18px rgba(34, 60, 92, 0.06);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: "Bahnschrift", "Segoe UI Variable", "Microsoft YaHei UI",
    "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Code", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(25, 118, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 54%, var(--bg-soft) 100%);
}

body.auth-page {
  background:
    radial-gradient(circle at top left, rgba(25, 118, 255, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(22, 155, 103, 0.08), transparent 26%),
    linear-gradient(180deg, #fafcff 0%, #f3f7fc 100%);
}

body.sidebar-open {
  overflow: hidden;
}

body.mobile-account-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
dl,
ul,
ol {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
button {
  font: inherit;
}

button {
  appearance: none;
}

code {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.mobile-only {
  display: none !important;
}

.desktop-only {
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 42px;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar-backdrop {
  display: none;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.sidebar-top {
  display: contents;
}

.sidebar-brand {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.sidebar-brand-mark {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-brand strong {
  font-size: 20px;
}

.sidebar-close,
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.sidebar-close span,
.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-close {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.sidebar-close span {
  position: absolute;
}

.sidebar-close span:first-child {
  transform: rotate(45deg);
}

.sidebar-close span:last-child {
  transform: rotate(-45deg);
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #cfe0ff;
}

.sidebar-section {
  display: grid;
  gap: 10px;
}

.sidebar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-user-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.sidebar-user-card strong {
  font-size: 15px;
}

.sidebar-user-card span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.sidebar-logout {
  margin-top: auto;
}

.sidebar-logout .button {
  width: 100%;
}

.app-main {
  min-width: 0;
  padding: 24px 28px 40px;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-toggle {
  width: 44px;
  height: 44px;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.app-topbar-copy {
  display: grid;
  gap: 4px;
}

.app-topbar-copy strong {
  font-size: 18px;
}

.app-topbar-copy span,
.app-topbar-user small {
  color: var(--muted);
}

.app-topbar-user {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-account-backdrop,
.mobile-account-sheet {
  display: none;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.flash {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.flash-success {
  color: var(--success);
  background: var(--success-soft);
  border-color: #bfead6;
}

.flash-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f0c5c0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head-compact {
  margin-bottom: 0;
}

.page-head h1 {
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-head p,
.section-head p,
.hero-text,
.field-note,
.tips-list li,
.task-script,
.task-script-hint,
.info-list dd,
.empty-state p,
.mini-empty-state {
  color: var(--muted);
  line-height: 1.7;
}

.page-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.page-kpis-desktop {
  margin-bottom: 0;
}

.dashboard-hero {
  margin-bottom: 18px;
}

.dashboard-hero-main {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.95) 100%);
  box-shadow: var(--shadow-sm);
}

.kpi-card {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kpi-card strong {
  font-size: 28px;
  line-height: 1;
}

.mobile-panel-switcher {
  display: none;
}

.mobile-overview {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mobile-overview summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.mobile-overview summary::-webkit-details-marker {
  display: none;
}

.mobile-overview-copy {
  display: grid;
  gap: 4px;
}

.mobile-overview-copy strong {
  font-size: 15px;
}

.mobile-overview-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mobile-overview-chevron {
  width: 10px;
  height: 10px;
  margin-right: 2px;
  border-right: 2px solid #7c8da0;
  border-bottom: 2px solid #7c8da0;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.mobile-overview[open] .mobile-overview-chevron {
  transform: rotate(-135deg);
}

.page-kpis-mobile {
  margin: 0;
  padding: 0 12px 12px;
}

.mobile-panel-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.mobile-panel-button.is-active {
  border-color: #cfe0ff;
  background: var(--accent-soft);
  color: var(--accent);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 380px);
  gap: 18px;
}

.workspace-main,
.workspace-side {
  min-width: 0;
}

.workspace-side {
  display: grid;
  gap: 18px;
  position: relative;
}

.admin-side-rail {
  align-self: start;
}

.workspace-grid-empty {
  grid-template-columns: 1fr;
}

.workspace-side-empty {
  gap: 16px;
}

.mobile-panel {
  display: block;
}

.section-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-panel-collapsible {
  padding: 0;
  overflow: hidden;
}

.section-panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.section-panel-summary::-webkit-details-marker {
  display: none;
}

.section-panel-summary-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.section-panel-summary-copy h2 {
  margin: 0;
}

.section-panel-summary-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.section-panel-summary::after {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid #7c8da0;
  border-bottom: 2px solid #7c8da0;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.section-panel-collapsible[open] .section-panel-summary::after {
  transform: rotate(-135deg);
}

.section-panel-body {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
}

.sticky-panel {
  position: sticky;
  top: 24px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head h2,
.section-head h3 {
  margin-bottom: 6px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-filters label {
  display: grid;
  gap: 8px;
}

.mini-note {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d7e5ff;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.view-toggle-button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.view-toggle-button.is-active {
  background: #fff;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.task-view {
  display: none;
}

.task-view.is-active {
  display: block;
}

.admin-view {
  display: none;
}

.admin-view.is-active {
  display: block;
}

.task-form,
.admin-action-group {
  display: grid;
  gap: 14px;
}

.task-form label {
  display: grid;
  gap: 8px;
}

.task-form span {
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #8b98a6;
}

input:focus,
select:focus {
  outline: none;
  border-color: #8db9ff;
  box-shadow: 0 0 0 4px rgba(25, 118, 255, 0.12);
  background: #fcfeff;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toggle-line {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.toggle-line input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button.has-icon {
  gap: 8px;
}

.button.has-icon::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: currentColor;
  -webkit-mask: var(--button-icon) center / contain no-repeat;
  mask: var(--button-icon) center / contain no-repeat;
}

.button-small.has-icon::before {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
}

.button.has-icon[data-icon="play"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="pause"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 5h4v14H7zm6 0h4v14h-4z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="edit"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 17.25V21h3.75l11.02-11.03-3.75-3.75L3 17.25zm2.92 2.33H5v-.92l8.06-8.06.92.92-8.06 8.06zM20.71 7.04a1.003 1.003 0 0 0 0-1.42l-2.33-2.33a1.003 1.003 0 0 0-1.42 0L15.12 5.12l3.75 3.75 1.84-1.83z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="copy"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16 1H4c-1.1 0-2 .9-2 2v12h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="trash"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 7h12l-1 14H7L6 7zm3-4h6l1 2h4v2H4V5h4l1-2z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="plus"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="eye"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 5c-7 0-10 7-10 7s3 7 10 7 10-7 10-7-3-7-10-7zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-2.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="key"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 14a5 5 0 1 1 4.9-6H22v4h-2v2h-2v2h-2.1A5 5 0 0 1 7 14zm0-2a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="user-plus"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M15 12c2.21 0 4-1.79 4-4S17.21 4 15 4s-4 1.79-4 4 1.79 4 4 4zM9 9H6V6H4v3H1v2h3v3h2v-3h3zm6 5c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="mail"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="more"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle fill='black' cx='5' cy='12' r='2'/%3E%3Ccircle fill='black' cx='12' cy='12' r='2'/%3E%3Ccircle fill='black' cx='19' cy='12' r='2'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="check"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.button.has-icon[data-icon="close"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.29l6.3 6.3 6.29-6.3z'/%3E%3C/svg%3E");
}

.button:hover {
  background: #f8fbff;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: #1669e0;
}

.button-hero {
  min-width: 148px;
}

.button-ghost {
  background: var(--panel-soft);
}

.button-danger {
  color: var(--danger);
  border-color: #efc4bf;
  background: var(--danger-soft);
}

.button-danger:hover {
  background: #ffe8e4;
}

.button-small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-note {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.form-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbfdff;
  overflow: hidden;
}

.form-section:not([open]) {
  background: #fff;
}

.form-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.form-section summary::-webkit-details-marker {
  display: none;
}

.form-section summary strong {
  font-size: 15px;
}

.form-section summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.form-section summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid #7c8da0;
  border-bottom: 2px solid #7c8da0;
  transform: rotate(45deg);
  transition: transform 160ms ease;
  flex: 0 0 auto;
}

.form-section[open] summary::after {
  transform: rotate(-135deg);
}

.form-section-body {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.env-editor,
.embedded-list {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbfdff;
}

.embedded-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbfdff;
  overflow: hidden;
}

.embedded-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.embedded-details summary::-webkit-details-marker {
  display: none;
}

.embedded-details .embedded-list {
  margin: 0 14px 14px;
}

.env-section-head,
.embedded-head,
.task-card-top,
.env-preview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.env-section-head {
  margin-bottom: 14px;
}

.env-inline-guide {
  margin-bottom: 12px;
}

.env-header {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.env-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr) minmax(0, 0.9fr) auto;
  gap: 10px;
  align-items: center;
}

.env-rows,
.task-list,
.user-list,
.env-preview-list,
.subtask-list,
.tips-list {
  display: grid;
  gap: 14px;
}

.env-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.env-field {
  display: grid;
  gap: 8px;
}

.env-field-label {
  display: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.info-list,
.task-meta-grid,
.subtask-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.info-list div,
.task-meta-grid div,
.subtask-meta div {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.info-list dt,
.task-meta-grid dt,
.subtask-meta dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.info-list dd,
.task-meta-grid dd,
.subtask-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.task-card,
.user-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.task-card:hover,
.user-card:hover {
  transform: translateY(-1px);
}

.task-card.is-editing {
  border-color: #a8c8ff;
  box-shadow: inset 0 0 0 1px #cfe0ff;
}

.task-card-running {
  border-color: #f0d09f;
  box-shadow: inset 4px 0 0 rgba(201, 120, 24, 0.9);
  background: linear-gradient(180deg, #fffdfa 0%, #ffffff 100%);
}

.task-card-success {
  border-color: #dfeee6;
  box-shadow: inset 4px 0 0 rgba(22, 155, 103, 0.58);
}

.task-card-error,
.task-card-timeout {
  border-color: #f2cbc7;
  box-shadow: inset 4px 0 0 rgba(210, 77, 68, 0.92), 0 0 0 1px rgba(210, 77, 68, 0.08);
  background: linear-gradient(180deg, #fff8f7 0%, #ffffff 100%);
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.task-script {
  font-size: 14px;
}

.task-script-hint {
  font-size: 13px;
}

.status-stack,
.summary-tags,
.task-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-stack {
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge-with-dot {
  gap: 6px;
  padding-left: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot-running {
  animation: pulse 1.3s ease infinite;
}

.badge-outline {
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}

.badge-soft {
  color: var(--accent);
  background: var(--accent-soft);
}

.badge-idle,
.badge-skipped {
  color: var(--muted);
  background: #eef2f7;
}

.badge-running {
  color: var(--warning);
  background: #fff1d9;
}

.badge-success {
  color: var(--success);
  background: #f3fbf6;
}

.badge-error,
.badge-timeout {
  color: var(--danger);
  background: #ffe4e0;
  box-shadow: inset 0 0 0 1px rgba(210, 77, 68, 0.12);
}

.env-preview-card,
.subtask-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.env-preview-top strong,
.subtask-card strong {
  font-size: 14px;
}

.env-preview-top span {
  color: var(--muted);
  font-size: 12px;
}

.env-preview-card code {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f3f7fd;
  color: #315073;
  font-size: 12px;
  word-break: break-all;
}

.env-secret-row {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.env-secret-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.env-secret-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-toolbar {
  margin-top: 16px;
  margin-bottom: 16px;
}

.task-toolbar form {
  margin: 0;
}

.task-card-actions-mobile {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.card-primary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-primary-actions .button,
.card-primary-actions a.button,
.card-primary-actions form,
.action-menu-panel .button,
.action-menu-panel a.button,
.action-menu-panel form {
  width: 100%;
}

.action-menu {
  display: grid;
  gap: 10px;
}

.action-menu summary {
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-panel {
  display: grid;
  gap: 10px;
}

.task-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.task-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.task-table thead th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  background: #f9fbfe;
}

.task-table tbody td {
  padding: 14px 16px;
  border-top: 1px solid #edf2f7;
  vertical-align: top;
}

.task-table-row-running td:first-child {
  box-shadow: inset 4px 0 0 rgba(201, 120, 24, 0.85);
}

.task-table-row-running td {
  background: #fffdfa;
}

.task-table-row-success td:first-child {
  box-shadow: inset 4px 0 0 rgba(22, 155, 103, 0.85);
}

.task-table-row-success td {
  background: #fcfefc;
}

.task-table-row-error td:first-child,
.task-table-row-timeout td:first-child {
  box-shadow: inset 4px 0 0 rgba(210, 77, 68, 0.9);
}

.task-table-row-error td,
.task-table-row-timeout td {
  background: #fff8f7;
}

.table-task-main {
  display: grid;
  gap: 4px;
}

.table-task-main strong {
  font-size: 14px;
}

.table-task-main span,
.table-muted {
  color: var(--muted);
  font-size: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.admin-table .table-actions {
  justify-content: flex-end;
}

.admin-table {
  min-width: 0;
  table-layout: fixed;
}

.admin-table-row td {
  vertical-align: middle;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
  width: 24%;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 12%;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 16%;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
  width: 10%;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
  width: 18%;
}

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
  width: 20%;
}

.admin-table .table-task-main,
.admin-table .status-stack {
  min-width: 0;
}

.admin-table .table-task-main span,
.admin-table .table-muted {
  overflow-wrap: anywhere;
}

.admin-table .table-actions {
  justify-content: flex-start;
}

.admin-detail-panel {
  border-radius: 12px;
}

.admin-detail-body {
  display: grid;
  gap: 14px;
  padding: 0 14px 14px;
}

.admin-inline-form {
  align-items: center;
}

.admin-task-compact-list {
  display: grid;
  gap: 10px;
}

.admin-task-compact-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-task-compact-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-task-compact-main strong {
  font-size: 14px;
}

.admin-task-compact-main span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.task-table-log-row td {
  padding-top: 0;
  background: #fcfdff;
}

.inline-log-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.inline-log-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.inline-log-details summary::-webkit-details-marker {
  display: none;
}

.inline-log-details pre,
.log-panel pre {
  margin: 0;
  padding: 0 14px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #2c4560;
}

.log-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfdff;
  overflow: hidden;
}

.log-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.log-panel summary::-webkit-details-marker {
  display: none;
}

.summary-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.summary-tag-running {
  background: var(--warning-soft);
  color: var(--warning);
}

.summary-tag-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.schedule-preview {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #d7e5ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
}

.schedule-preview strong {
  font-size: 14px;
}

.schedule-preview span {
  color: var(--text);
}

.schedule-preview small {
  color: var(--muted);
  font-size: 12px;
}

.notification-config {
  display: grid;
  gap: 14px;
}

.notification-config.is-disabled {
  opacity: 0.55;
}

.notification-save-row {
  display: flex;
  justify-content: flex-start;
}

.mini-empty-state,
.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--panel-soft);
}

.empty-state {
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state-strong {
  display: grid;
  gap: 16px;
  padding: 26px 22px;
  border-style: solid;
  background: linear-gradient(180deg, #fbfdff 0%, #f6faff 100%);
}

.empty-state-copy {
  display: grid;
  gap: 8px;
}

.empty-state-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.tips-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tips-list li {
  position: relative;
  padding: 12px 14px 12px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.tips-list li::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
}

.auth-panel {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-panel h1 {
  font-size: clamp(30px, 6vw, 38px);
  line-height: 1.08;
}

.auth-form {
  margin-top: 20px;
}

.notice-card {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #d7e5ff;
  border-radius: 14px;
  background: var(--accent-soft);
}

.notice-card strong {
  display: block;
  margin-bottom: 8px;
}

.notice-card p + p,
.notice-card code {
  margin-top: 8px;
}

.slider-verify {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.slider-verify-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.slider-verify-head strong {
  display: block;
  margin-bottom: 4px;
}

.slider-track {
  position: relative;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  user-select: none;
}

.slider-track.is-dragging {
  border-color: #9dc1ff;
}

.slider-track.is-verified {
  border-color: #91dbbb;
  background: #f1fbf6;
}

.slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 26px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(25, 118, 255, 0.15), rgba(22, 155, 103, 0.12));
}

.slider-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 56px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.slider-handle {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  touch-action: none;
}

.slider-handle::before {
  content: ">>";
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.slider-status {
  color: var(--muted);
  font-size: 13px;
}

.slider-status.is-error {
  color: var(--danger);
}

.slider-status.is-success {
  color: var(--success);
}

.slider-status.is-pending {
  color: var(--accent);
}

.is-hidden {
  display: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 120, 24, 0.45);
    transform: scale(1);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(201, 120, 24, 0);
    transform: scale(1.05);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(201, 120, 24, 0);
    transform: scale(1);
  }
}

@media (min-width: 981px) {
  :root {
    --shadow: 0 10px 24px rgba(34, 60, 92, 0.06);
    --shadow-sm: 0 4px 12px rgba(34, 60, 92, 0.05);
    --radius-xl: 12px;
    --radius-lg: 10px;
    --radius-md: 10px;
    --radius-sm: 8px;
  }

  .app-sidebar {
    gap: 18px;
    padding: 20px 16px;
  }

  .app-main {
    padding: 20px 24px 32px;
  }

  .app-topbar {
    margin-bottom: 18px;
    padding-bottom: 16px;
  }

  .page-kpis {
    gap: 12px;
    margin-bottom: 16px;
  }

  .dashboard-hero {
    margin-bottom: 16px;
  }

  .dashboard-hero-main {
    padding: 18px 20px;
  }

  .workspace-grid,
  .workspace-side {
    gap: 16px;
  }

  .section-panel,
  .task-card,
  .user-card {
    padding: 18px;
  }

  .kpi-card {
    padding: 16px 18px;
  }

  .env-editor,
  .embedded-list {
    padding: 14px;
  }

  .task-list,
  .user-list,
  .env-preview-list,
  .subtask-list,
  .tips-list {
    gap: 12px;
  }

  .section-head {
    margin-bottom: 16px;
  }
}

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .workspace-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .sticky-panel {
    position: static;
  }
}

@media (min-width: 981px) {
  body.device-desktop .admin-workspace-grid {
    --admin-rail-width: clamp(320px, 26vw, 380px);
    display: block;
    padding-right: calc(var(--admin-rail-width) + 20px);
  }

  body.device-desktop .admin-side-rail {
    position: fixed;
    top: 20px;
    right: 24px;
    bottom: 20px;
    z-index: 30;
    width: var(--admin-rail-width);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 4px;
    align-self: auto;
    scrollbar-gutter: stable;
  }

  body.device-desktop .admin-create-panel {
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 auto;
  }
}

@media (max-width: 980px) {
  .mobile-only {
    display: block !important;
  }

  .desktop-only {
    display: none !important;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .sidebar-backdrop,
  .sidebar-close,
  .sidebar-toggle {
    display: none !important;
  }

  .app-main {
    padding: 18px 16px 96px;
  }

  .app-topbar {
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .app-topbar-left {
    gap: 0;
  }

  .app-topbar-user {
    display: none;
  }

  .page-head {
    margin-bottom: 14px;
  }

  .page-head p {
    display: none;
  }

  .page-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    padding: 14px 16px;
  }

  .kpi-card strong {
    font-size: 22px;
  }

  .mobile-panel-switcher {
    position: sticky;
    top: 8px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px;
    border: 1px solid rgba(201, 214, 229, 0.9);
    border-radius: 14px;
    background: rgba(248, 251, 255, 0.92);
    backdrop-filter: blur(8px);
  }

  .mobile-panel-button {
    min-height: 40px;
    padding: 0 10px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .workspace-side {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .admin-filters {
    grid-template-columns: 1fr;
  }

  .env-grid {
    grid-template-columns: 1fr;
  }

  .env-header {
    display: none;
  }

  .env-field-label {
    display: block;
  }

  .workspace-grid > .mobile-panel:not(.is-active),
  .workspace-side > .mobile-panel:not(.is-active) {
    display: none !important;
  }

  .workspace-grid > .mobile-panel.is-active,
  .workspace-side > .mobile-panel.is-active {
    display: block !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 12px;
    z-index: 30;
    width: min(460px, calc(100vw - 20px));
    transform: translateX(-50%);
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(201, 214, 229, 0.9);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.96);
    box-shadow: 0 12px 24px rgba(34, 60, 92, 0.12);
    backdrop-filter: blur(10px);
  }

  .mobile-bottom-link {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
  }

  .mobile-bottom-link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .mobile-bottom-link span {
    display: block;
    width: 100%;
    text-align: center;
  }

  .mobile-account-backdrop {
    position: fixed;
    inset: 0;
    z-index: 31;
    display: block !important;
    border: 0;
    padding: 0;
    background: rgba(28, 43, 61, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .mobile-account-sheet {
    position: fixed;
    right: 12px;
    bottom: 84px;
    left: 12px;
    z-index: 32;
    display: grid !important;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(201, 214, 229, 0.95);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 42px rgba(34, 60, 92, 0.16);
    transform: translateY(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    backdrop-filter: blur(12px);
  }

  body.mobile-account-open .mobile-account-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-account-open .mobile-account-sheet {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-account-handle {
    width: 44px;
    height: 5px;
    margin: 0 auto;
    border-radius: 999px;
    background: #d4deea;
  }

  .mobile-account-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-account-head strong {
    display: block;
    font-size: 17px;
  }

  .mobile-account-head span {
    color: var(--muted);
    font-size: 13px;
  }

  .mobile-account-close {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
  }

  .mobile-account-close span {
    position: absolute;
    top: 17px;
    left: 9px;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-account-close span:first-child {
    transform: rotate(45deg);
  }

  .mobile-account-close span:last-child {
    transform: rotate(-45deg);
  }

  .mobile-account-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-soft);
  }

  .mobile-account-card strong {
    font-size: 15px;
  }

  .mobile-account-card span {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .mobile-account-actions {
    display: grid;
    gap: 10px;
  }

  .mobile-account-actions .button,
  .mobile-account-actions a.button,
  .mobile-account-logout,
  .mobile-account-logout .button {
    width: 100%;
  }

  .empty-state-actions {
    flex-direction: column;
  }

  .empty-state-actions .button,
  .empty-state-actions a.button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: calc(100vw - 18px);
    padding: 18px 0 28px;
  }

  .page-head,
  .section-head,
  .task-card-top,
  .env-section-head,
  .embedded-head,
  .slider-verify-head,
  .app-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-topbar-left {
    width: 100%;
  }

  .app-topbar-copy span {
    display: none;
  }

  .app-topbar-copy strong {
    font-size: 16px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .page-kpis,
  .task-meta-grid,
  .subtask-meta,
  .info-list,
  .form-row,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .task-toolbar,
  .form-actions,
  .table-actions,
  .admin-task-compact-item,
  .card-primary-actions,
  .env-secret-actions {
    flex-direction: column;
  }

  .task-toolbar .button,
  .task-toolbar a.button,
  .task-toolbar form,
  .inline-form .button,
  .form-actions .button,
  .form-actions a.button,
  .notification-save-row .button,
  .table-actions .button,
  .table-actions a.button,
  .table-actions form,
  .admin-inline-form .button,
  .env-secret-actions .button,
  .env-secret-actions a.button {
    width: 100%;
  }

  .admin-inline-form {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .section-panel,
  .task-card,
  .user-card {
    padding: 16px;
  }

  .section-panel-collapsible {
    padding: 0;
  }

  .section-panel-summary {
    align-items: flex-start;
    padding: 16px;
  }

  .section-panel-summary::after {
    margin-top: 6px;
  }

  .section-panel-body {
    padding: 16px;
  }

  .form-section summary {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .app-main {
    padding: 14px 12px 92px;
  }

  .page-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .section-panel,
  .task-card,
  .user-card,
  .auth-panel {
    border-radius: 16px;
  }

  input,
  select,
  .button {
    min-height: 44px;
    font-size: 16px;
  }

  .summary-tags {
    width: 100%;
  }

  .auth-panel {
    width: 100%;
    padding: 18px;
  }

  .mobile-bottom-nav {
    bottom: 10px;
    width: min(430px, calc(100vw - 16px));
  }

  .mobile-account-sheet {
    right: 10px;
    bottom: 80px;
    left: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
