:root {
  color-scheme: light;
  --green: #17b26a;
  --green-dark: #087443;
  --blue: #2563eb;
  --ink: #182230;
  --muted: #667085;
  --line: #d0d5dd;
  --soft: #f2f4f7;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #f8fafc;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 800;
  color: var(--green-dark);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo img {
  display: block;
  width: 142px;
  max-width: 42vw;
  max-height: 42px;
  height: auto;
  object-fit: contain;
}

.menu {
  position: absolute;
  top: calc(100% + 1px);
  right: 18px;
  display: none;
  width: min(260px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
  font-size: 14px;
}

.menu.open {
  display: grid;
  gap: 4px;
}

.menu a {
  display: block;
  padding: 10px 8px;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.menu a:active,
.menu a:hover {
  background: var(--soft);
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 38px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.menu-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.hero {
  padding: 18px;
  background: linear-gradient(180deg, #ecfdf3 0%, #ffffff 100%);
}

.hero h1 {
  max-width: 620px;
  margin: 0 auto 6px;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
}

.hero p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

.wrap {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}

.grid > .panel:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.panel,
.job,
.admin-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel,
.admin-panel {
  padding: 12px;
}

.panel h2,
.admin-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.tips-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.tips-list h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.tips-list p,
.legal-page p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.legal-page h1 {
  margin: 0 0 14px;
  font-size: 26px;
}

.legal-page h2 {
  margin-top: 18px;
}

.jobs,
.form,
.list {
  display: grid;
  gap: 8px;
}

.job {
  position: relative;
  display: block;
  padding: 11px 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.job:hover,
.job:focus-visible {
  border-color: var(--green);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.job h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 5px;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 12px;
}

.meta a,
.meta span {
  color: var(--green-dark);
  text-decoration: none;
}

.job-arrow {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  font-size: 11px;
}

.job p,
.small {
  color: var(--muted);
  line-height: 1.35;
}

.job p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: var(--white);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  color: var(--muted);
}

.check input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--green);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

#gateButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border-radius: 10px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 10px 22px rgba(23, 178, 106, 0.32);
  font-size: 16px;
}

#gateButton.with-chrome-icon {
  background: linear-gradient(180deg, #1a73e8 0%, #0b57d0 100%);
  box-shadow: 0 10px 22px rgba(26, 115, 232, 0.3);
}

.chrome-icon {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #4285f4 0 31%, #ffffff 32% 41%, transparent 42%),
    conic-gradient(#ea4335 0 33%, #fbbc04 0 66%, #34a853 0 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

#gateButton:active {
  transform: translateY(1px);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--green);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.install-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.install-panel {
  width: min(460px, 100%);
}

.install-panel h1 {
  margin: 0 0 10px;
  font-size: 24px;
}

button.secondary {
  background: var(--blue);
}

button.compact {
  min-height: 34px;
  padding: 0 10px;
}

button.danger {
  min-height: 34px;
  background: #d92d20;
}

.status {
  min-height: 20px;
  color: var(--green-dark);
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 18px;
  background: #101828;
  color: var(--white);
}

.sidebar h1 {
  margin: 0 0 18px;
  font-size: 18px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tabs button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: left;
}

.tabs button.active {
  background: var(--green);
  border-color: var(--green);
}

.admin-main {
  padding: 18px;
}

.server-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.server-clock strong {
  color: var(--green-dark);
}

.server-clock span {
  color: var(--muted);
  font-size: 12px;
}

.locked-admin .admin-panel {
  display: none;
}

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

.daily-chart-wrap {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.campaign-history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.daily-chart-wrap h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.chart-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.date-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-filters label {
  min-width: 150px;
  font-size: 12px;
}

.date-filters input {
  min-height: 36px;
  padding: 7px 9px;
}

.daily-chart {
  display: grid;
  gap: 10px;
}

.chart-row {
  display: grid;
  gap: 5px;
}

.chart-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
}

.chart-label strong {
  min-width: 28px;
  color: var(--green-dark);
}

.chart-value {
  display: grid;
  min-width: 56px;
}

.chart-value small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.chart-label span {
  color: var(--muted);
  font-size: 13px;
}

.chart-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.chart-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.hidden {
  display: none !important;
}

.app-locked .topbar,
.app-locked .hero,
.app-locked main {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

.notification-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(248, 250, 252, 0.82);
}

.gate-panel {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
}

.gate-tag {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.gate-panel h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.15;
}

.gate-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fcfcfd;
}

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

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.subsection-title {
  margin-top: 18px !important;
}

.schedule-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.resume-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px;
  align-items: start;
}

.resume-hero {
  padding: 20px 0 8px;
  background: linear-gradient(180deg, #ecfdf3 0%, #f8fafc 100%);
}

.resume-hero h1 {
  max-width: 720px;
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.resume-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.resume-preview {
  min-height: 760px;
  padding: 38px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cv-header {
  padding-bottom: 14px;
  border-bottom: 2px solid var(--green);
}

.resume-preview h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.cv-role {
  margin-top: 6px;
  color: var(--green-dark);
  font-weight: 800;
}

.cv-contact {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.resume-preview h2 {
  margin: 24px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.resume-preview p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

@media (max-width: 760px) {
  .topbar {
    position: relative;
    padding: 8px 10px;
  }

  .brand {
    font-size: 15px;
  }

  .brand-logo img {
    width: 118px;
  }

  .menu {
    right: 10px;
    width: min(250px, calc(100vw - 20px));
  }

  .hero {
    padding: 8px 10px;
  }

  .hero .wrap {
    padding: 0;
  }

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

  .tips-list {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 100%;
    margin: 0 auto;
    font-size: 20px;
    line-height: 1.08;
    text-align: center;
  }

  .hero p {
    display: none;
  }

  .wrap {
    padding: 8px;
  }

  .panel {
    padding: 8px;
  }

  .panel h2 {
    margin-bottom: 6px;
    font-size: 15px;
  }

  .job {
    padding: 7px 8px;
  }

  .job h3 {
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 1.15;
  }

  .meta {
    margin-bottom: 3px;
    font-size: 11px;
  }

  input,
  textarea {
    min-height: 38px;
    padding: 8px 10px;
  }

  button {
    min-height: 40px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
  }

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

  .resume-layout {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .resume-preview {
    min-height: auto;
    padding: 18px;
  }

  .resume-preview h1 {
    font-size: 23px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .no-print {
    display: none !important;
  }

  .resume-layout {
    display: block;
    width: 100%;
    padding: 0;
  }

  .resume-preview {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }
}
