:root {
  --bg-top: #f6efe2;
  --bg-bottom: #d8e6f0;
  --ink: #122033;
  --muted: #566578;
  --card: rgba(255, 255, 255, 0.88);
  --line: rgba(18, 32, 51, 0.12);
  --accent: #0f766e;
  --accent-dark: #0b4f5d;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --sky-soft: rgba(14, 116, 144, 0.09);
  --amber-soft: rgba(245, 158, 11, 0.11);
  --violet-soft: rgba(139, 92, 246, 0.09);
  --mint-soft: rgba(16, 185, 129, 0.1);
  --rose-soft: rgba(225, 29, 72, 0.08);
  --danger: #8a1538;
  --shadow: 0 30px 70px rgba(18, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.app-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.update-banner {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.08);
}

.update-banner strong {
  display: block;
  color: #991b1b;
  font-size: 0.82rem;
  line-height: 1.2;
}

.update-banner p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.update-banner-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dc2626, #7f1d1d);
  color: white;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.app-version-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(14, 116, 144, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.app-footer {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.update-status,
.update-download {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.74rem;
  letter-spacing: 0;
}

.update-status.is-current {
  color: #0f5d34;
  border-color: rgba(21, 161, 80, 0.18);
  background: rgba(21, 161, 80, 0.1);
}

.update-status.is-available {
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(254, 226, 226, 0.88);
}

.update-status.is-offline {
  color: var(--muted);
}

.update-download {
  color: #fff;
  border-color: rgba(11, 79, 93, 0.2);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.update-download[hidden] {
  display: none;
}

.hero-card,
.workspace-card {
  position: relative;
  overflow: visible;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  padding: 24px;
}

.brand-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand-logo {
  width: clamp(190px, 28vw, 330px);
  height: auto;
  flex: 0 0 auto;
  display: block;
  border-radius: 12px;
  mix-blend-mode: multiply;
}

.brand-title {
  min-width: 0;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(11, 79, 93, 0.04));
  pointer-events: none;
}

.workspace-card {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82)),
    linear-gradient(135deg, rgba(14, 116, 144, 0.03), rgba(15, 118, 110, 0.03));
}

.logs-page h1 {
  font-size: 2.2rem;
}

.logs-header,
.logs-layout {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 28px rgba(18, 32, 51, 0.06);
}

.logs-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.logs-header h1,
.logs-header p,
.logs-list-panel h2,
.logs-detail-panel h2,
.logs-detail-panel p {
  margin: 0;
}

.logs-header p,
.logs-detail-panel p {
  color: var(--muted);
}

.logs-layout {
  margin-top: 14px;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.logs-list-panel,
.logs-detail-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.logs-list {
  display: grid;
  gap: 8px;
}

.log-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.log-list-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.log-list-item.is-active {
  border-color: rgba(15, 118, 110, 0.38);
  background: rgba(15, 118, 110, 0.09);
}

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

.log-content {
  min-height: 520px;
  max-height: 68vh;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(18, 32, 51, 0.14);
  background: #101827;
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sync-panels-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.template-sync-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 20px rgba(18, 32, 51, 0.05);
}

.template-sync-panel h2 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.15;
}

.template-sync-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.template-sync-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.template-sync-actions .secondary-button,
.secondary-link {
  min-height: 30px;
  margin-top: 0;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  line-height: 1;
  white-space: nowrap;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(18, 32, 51, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 249, 0.92));
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.secondary-link.is-disabled,
.secondary-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.54;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.template-sync-copy.is-ready {
  color: #0f5d34;
}

.template-sync-copy.is-loading {
  color: var(--accent-dark);
}

.template-sync-copy.is-offline {
  color: var(--danger);
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 720px;
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--muted);
}

.stats-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.stat-card,
.status-panel,
.result-panel {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.stat-card {
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), #0ea5a5);
  opacity: 0.8;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.9rem;
  line-height: 1;
}

.generator-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  padding: 4px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.65), rgba(255, 255, 255, 0.35));
}

.side-column {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 4px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.6), rgba(255, 255, 255, 0.28));
}

.form-header {
  grid-column: 1 / -1;
  padding: 2px 2px 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-header h2 {
  margin: 0;
  font-size: 1.16rem;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(14, 116, 144, 0.06));
}

.form-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(18, 32, 51, 0.08);
}

.form-meta {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.08), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(14, 116, 144, 0.12);
}

.field-card {
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  min-height: 188px;
  display: grid;
  align-content: start;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(18, 32, 51, 0.05);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.field-card--dates {
  overflow: visible;
  z-index: 45;
}

.field-card--wide {
  grid-column: 1 / -1;
  min-height: auto;
}

.field-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #facc15, #f59e0b);
}

.field-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(18, 32, 51, 0.08);
}

.field-card.is-pending::before {
  background: linear-gradient(90deg, #facc15, #f59e0b);
}

.field-card.is-complete {
  border-color: rgba(22, 163, 74, 0.22);
  box-shadow: 0 16px 30px rgba(22, 163, 74, 0.09);
}

.field-card.is-complete::before {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.field-card.is-error {
  border-color: rgba(220, 38, 38, 0.22);
  box-shadow: 0 16px 30px rgba(220, 38, 38, 0.08);
}

.field-card.is-error::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.action-row {
  grid-column: 1 / -1;
}

.field-group-head {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.field-group-head > span {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
}

.compact-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.compact-fields-grid--double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.photo-field {
  display: grid;
  grid-template-rows: 22px 174px 32px minmax(128px, auto);
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(18, 32, 51, 0.1);
  border-radius: 16px;
  background: rgba(250, 252, 255, 0.78);
  min-width: 0;
}

.photo-field-title {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.photo-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 174px;
  min-height: 174px;
  overflow: hidden;
  border: 1px dashed rgba(14, 116, 144, 0.3);
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(14, 116, 144, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(14, 116, 144, 0.08) 25%, transparent 25%),
    rgba(255, 255, 255, 0.82);
  color: var(--accent-dark);
  text-align: center;
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.photo-placeholder-copy {
  padding: 10px;
  font-weight: 800;
  color: rgba(11, 79, 93, 0.72);
}

.photo-size-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(18, 32, 51, 0.82);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
}

.photo-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.photo-file-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(18, 32, 51, 0.08);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.photo-file-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.2;
}

.photo-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  min-height: 128px;
  overflow: visible;
}

.field {
  display: grid;
  gap: 6px;
  position: relative;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(18, 32, 51, 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 255, 0.94));
  color: var(--ink);
  font-size: 0.98rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent-dark) 50%),
    linear-gradient(135deg, var(--accent-dark) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 255, 0.94));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  font-weight: 800;
}

.field-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
}

.field input[readonly] {
  background: rgba(238, 244, 246, 0.95);
  color: var(--accent-dark);
}

.field-help {
  margin: 6px 0 0;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.35;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
  transform: translateY(-1px);
}

.calendar-popover {
  position: fixed;
  width: 288px;
  z-index: 1000;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(18, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(18, 32, 51, 0.18);
}

.calendar-popover[hidden] {
  display: none;
}

.calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  text-align: center;
  text-transform: capitalize;
}

.calendar-nav,
.calendar-day {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.calendar-nav {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(14, 116, 144, 0.1);
  color: var(--accent-dark);
  font-size: 1.2rem;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 10px;
  background: rgba(18, 32, 51, 0.05);
  color: var(--muted);
}

.calendar-day.is-saturday {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.calendar-day.is-selected {
  background: #b91c1c;
  color: white;
}

.calendar-day.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.calendar-day.is-empty {
  background: transparent;
}

.field input.is-invalid {
  border-color: rgba(138, 21, 56, 0.45);
  box-shadow: 0 0 0 4px rgba(138, 21, 56, 0.08);
}

.field input.is-valid {
  border-color: rgba(21, 161, 80, 0.34);
}

.ghost-button {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(18, 32, 51, 0.14);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(14, 116, 144, 0.05));
  color: var(--accent-dark);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(18, 32, 51, 0.08);
  border-color: rgba(15, 118, 110, 0.34);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.2), rgba(14, 116, 144, 0.14));
  color: #083d4a;
}

.ghost-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 4px 10px rgba(18, 32, 51, 0.12);
  filter: brightness(0.97);
}

.ghost-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.16), 0 10px 20px rgba(18, 32, 51, 0.08);
}

.field-button {
  width: 100%;
  margin-top: 8px;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: center;
}

.submit-button {
  margin-top: 2px;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  box-shadow: 0 16px 30px rgba(11, 79, 93, 0.24);
}

.submit-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #14b8a6, #0b7285);
  box-shadow: 0 18px 32px rgba(11, 79, 93, 0.28);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.submit-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 16px rgba(11, 79, 93, 0.2);
  filter: brightness(0.96);
}

.submit-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18), 0 16px 30px rgba(11, 79, 93, 0.24);
}

.secondary-button {
  margin-top: 2px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(18, 32, 51, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 249, 0.92));
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(18, 32, 51, 0.08);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.14), rgba(15, 118, 110, 0.09));
  border-color: rgba(14, 116, 144, 0.22);
  color: var(--accent-dark);
}

.secondary-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 4px 10px rgba(18, 32, 51, 0.1);
  filter: brightness(0.98);
}

.secondary-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.12), 0 10px 20px rgba(18, 32, 51, 0.08);
}

.status-panel,
.result-panel,
.history-panel {
  padding: 16px;
  box-shadow: 0 14px 28px rgba(18, 32, 51, 0.06);
}

.status-panel {
  align-self: start;
  border-left: 5px solid rgba(14, 116, 144, 0.35);
}

.status-panel.is-loading {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(11, 79, 93, 0.06));
}

.status-panel.is-success {
  background: linear-gradient(135deg, rgba(17, 170, 88, 0.16), rgba(13, 117, 63, 0.08));
  border-color: rgba(17, 170, 88, 0.22);
}

.status-panel.is-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.08));
  border-color: rgba(245, 158, 11, 0.28);
}

.status-panel.is-error {
  background: rgba(138, 21, 56, 0.08);
  border-color: rgba(138, 21, 56, 0.18);
}

.status-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.status-copy,
.result-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.status-steps {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.status-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.status-step-label {
  font-weight: 700;
}

.status-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(18, 32, 51, 0.08);
  color: var(--muted);
  flex-shrink: 0;
}

.status-step--done {
  color: #0f5d34;
}

.status-step--done .status-step-icon {
  background: rgba(21, 161, 80, 0.14);
  color: #0f5d34;
}

.status-step--current {
  color: var(--accent-dark);
}

.status-step--current .status-step-icon {
  background: rgba(15, 118, 110, 0.14);
  color: var(--accent-dark);
}

.status-step--warning {
  color: #b56700;
}

.status-step--warning .status-step-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #b56700;
}

.status-step--error {
  color: #8a1538;
}

.status-step--error .status-step-icon {
  background: rgba(138, 21, 56, 0.12);
  color: #8a1538;
}

.status-panel.is-warning .status-title,
.status-panel.is-warning .status-copy {
  color: #9a6700;
}

.result-panel {
  display: grid;
  gap: 10px;
  border-left: 5px solid rgba(245, 158, 11, 0.4);
}

.result-panel h2,
.history-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.history-panel {
  border-left: 5px solid rgba(15, 118, 110, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 252, 0.9));
}

.history-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.history-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.history-filter {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.history-filter span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-filter select {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 250, 0.94));
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(18, 32, 51, 0.94);
  color: white;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: 0 12px 24px rgba(18, 32, 51, 0.2);
  z-index: 20;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.jump-link,
.clear-history-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 249, 0.92));
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.jump-link:hover {
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.18), rgba(15, 118, 110, 0.11));
  border-color: rgba(14, 116, 144, 0.24);
  color: #0b4f5d;
}

.clear-history-button:hover {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.08));
  border-color: rgba(217, 119, 6, 0.2);
  color: #9a6700;
}

.inline-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  transition: color 160ms ease, opacity 160ms ease;
}

.inline-link-button:hover {
  color: var(--accent);
  opacity: 0.85;
}

.jump-link:disabled,
.inline-link-button:disabled,
.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.download-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(18, 32, 51, 0.08);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.2), rgba(14, 116, 144, 0.14));
  color: #083d4a;
}

.result-list,
.document-list {
  display: grid;
  gap: 10px;
}

.result-status-box,
.documents-panel {
  display: grid;
  gap: 8px;
}

.result-status-box h3,
.documents-panel h3 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.result-item,
.document-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.coverage-row {
  margin-top: 8px;
  display: grid;
  gap: 5px;
}

.coverage-stack {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.coverage-stack .coverage-row {
  margin-top: 0;
}

.coverage-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.coverage-row.is-detailed .coverage-label {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(18, 32, 51, 0.06);
}

.coverage-summary {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 700;
}

.coverage-summary.is-on {
  background: rgba(21, 161, 80, 0.12);
  border-color: rgba(21, 161, 80, 0.2);
  color: #0f5d34;
}

.coverage-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.coverage-row.is-detailed .coverage-group {
  padding-left: 2px;
}

.coverage-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  font-size: 0.86rem;
}

.coverage-chip.is-on {
  color: #0f5d34;
  border-color: rgba(15, 93, 52, 0.18);
  background: rgba(17, 170, 88, 0.08);
}

.coverage-chip.is-off {
  color: #7a8797;
}

.coverage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8d1da;
}

.coverage-chip.is-on .coverage-dot {
  background: #15a150;
  box-shadow: 0 0 0 4px rgba(21, 161, 80, 0.14);
}

.coverage-chip.is-off .coverage-dot {
  background: #c8d1da;
}

.coverage-group.is-result {
  margin-top: 10px;
}

.history-list {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}

.history-group {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 30px rgba(18, 32, 51, 0.08);
}

.history-group-band {
  background: #0b7285;
}

.history-group--teal .history-group-band {
  background: linear-gradient(180deg, #0b7285, #0f766e);
}

.history-group--amber .history-group-band {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.history-group--violet .history-group-band {
  background: linear-gradient(180deg, #8b5cf6, #7c3aed);
}

.history-group--blue .history-group-band {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.history-group--rose .history-group-band {
  background: linear-gradient(180deg, #e11d48, #be123c);
}

.history-group-body {
  padding: 12px 14px;
}

.history-group-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.history-group-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-group-title-row h3 {
  margin: 0;
  font-size: 1.02rem;
}

.history-group-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.history-group-badge.is-duplicate {
  background: rgba(15, 118, 110, 0.12);
  color: #0f5d34;
}

.history-group-badge.is-single {
  background: rgba(18, 32, 51, 0.06);
  color: var(--muted);
}

.history-group-items {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.history-item {
  padding: 12px 12px 11px;
  border-radius: 16px;
  border: 1px solid rgba(18, 32, 51, 0.08);
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(246, 249, 252, 0.94));
}

.history-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.history-item-head span,
.history-empty {
  color: var(--muted);
}

.history-item-head strong {
  font-size: 0.98rem;
  line-height: 1.1;
}

.history-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 12px;
  border: 1px solid rgba(18, 32, 51, 0.1);
  background: rgba(246, 248, 250, 0.98);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.2;
}

.history-meta-chip strong {
  color: var(--ink);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-meta-chip--file {
  background: rgba(14, 116, 144, 0.08);
  border-color: rgba(14, 116, 144, 0.18);
}

.history-meta-chip--serial {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.14);
}

.history-meta-chip--dimensions {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

.history-meta-chip--emission {
  background: rgba(168, 85, 247, 0.07);
  border-color: rgba(168, 85, 247, 0.16);
}

.history-meta-chip--validity {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.16);
}

.history-meta-chip.is-shared {
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.1);
  color: #0f5d34;
}

.history-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-action,
.history-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 0;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.history-action--folder {
  background: linear-gradient(135deg, #114a63, #0b7285);
  color: white;
  box-shadow: 0 10px 22px rgba(11, 79, 93, 0.18);
}

.history-action--folder:hover {
  background: linear-gradient(135deg, #0f766e, #0891b2);
  color: white;
}

.history-action--zip {
  background: #fff4d8;
  color: #9a6700;
  border: 1px solid rgba(154, 103, 0, 0.14);
}

.history-action--zip:hover {
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  border-color: rgba(154, 103, 0, 0.22);
  color: #7c5200;
}

.history-open-button,
.history-action {
  cursor: pointer;
}

.history-action:hover,
.history-open-button:hover,
.clear-history-button:hover,
.jump-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(18, 32, 51, 0.1);
}

.jump-link:active,
.clear-history-button:active,
.history-action:active,
.history-open-button:active,
.download-link:active,
.inline-link-button:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.97);
}

.jump-link:focus-visible,
.clear-history-button:focus-visible,
.history-action:focus-visible,
.history-open-button:focus-visible,
.download-link:focus-visible,
.inline-link-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.14), 0 10px 20px rgba(18, 32, 51, 0.08);
}

.document-item a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.document-link-card {
  appearance: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(14, 116, 144, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 250, 0.95));
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.document-link-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(18, 32, 51, 0.08);
  border-color: rgba(14, 116, 144, 0.24);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.14), rgba(15, 118, 110, 0.09));
  color: #0b4f5d;
}

.inline-result-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-left: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 32, 51, 0.34);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.generation-modal {
  width: min(440px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(18, 32, 51, 0.28);
  text-align: center;
}

.generation-modal h2 {
  margin: 0;
  font-size: 1.25rem;
}

.generation-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-status-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-dark);
  font-weight: 900;
}

.modal-overlay.is-success .modal-status-icon {
  background: rgba(21, 161, 80, 0.14);
  color: #0f5d34;
}

.modal-overlay.is-error .modal-status-icon {
  background: rgba(138, 21, 56, 0.12);
  color: var(--danger);
}

.modal-progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 32, 51, 0.09);
}

.modal-progress-bar {
  display: block;
  height: 100%;
  width: 28%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #0ea5a5);
  transition: width 240ms ease;
}

.modal-progress-bar.is-running {
  animation: modal-progress 1.4s ease-in-out infinite alternate;
}

.modal-overlay.is-error .modal-progress-bar {
  background: linear-gradient(90deg, #8a1538, #dc2626);
}

.modal-time {
  font-size: 0.86rem;
  font-weight: 700;
}

.modal-close-button {
  min-width: 120px;
}

@keyframes modal-progress {
  from {
    width: 28%;
  }
  to {
    width: 82%;
  }
}

@media (max-width: 860px) {
  .brand-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-logo {
    width: min(280px, 100%);
  }

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

  .sync-panels-grid {
    grid-template-columns: 1fr;
  }

  .template-sync-panel {
    grid-template-columns: 1fr;
  }

  .update-banner,
  .logs-header,
  .logs-layout {
    grid-template-columns: 1fr;
  }

  .update-banner-button {
    justify-self: start;
  }

  .hero-card {
    overflow: hidden;
  }

  .logs-detail-head {
    flex-direction: column;
  }

  .log-content {
    min-height: 360px;
  }

  .template-sync-actions {
    justify-content: flex-start;
  }

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

  .action-row {
    grid-template-columns: 1fr;
  }

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

  .history-head {
    flex-direction: column;
  }

  .history-tools {
    width: 100%;
    align-items: flex-start;
  }

  .history-filter {
    justify-items: start;
  }

  .form-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .compact-fields-grid,
  .compact-fields-grid--double,
  .photo-fields-grid {
    grid-template-columns: 1fr;
  }
}
