:root {
  color: #1f2723;
  background: #f6f7f4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(24, 91, 69, 0.08), transparent 32%),
    linear-gradient(225deg, rgba(179, 73, 48, 0.08), transparent 28%),
    #f6f7f4;
}

button {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100svh;
  padding: 20px;
}

.workspace {
  width: min(100%, 640px);
  margin: 0 auto;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.eyebrow {
  margin: 0;
  color: #65716a;
  font-size: 13px;
}

h2,
p {
  margin: 0;
}

h2 {
  color: #17211c;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: 0;
}

.status-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c8cec8;
  transition: background 0.18s ease, transform 0.18s ease;
}

.status-dot.ready {
  background: #16845d;
  transform: scale(1.15);
}

.state-view,
.vote-form {
  animation: rise 0.32s ease both;
}

.state-view {
  display: grid;
  min-height: 54svh;
  place-items: center;
  gap: 16px;
  padding: 40px 18px;
  text-align: center;
}

.state-view p {
  max-width: 360px;
  color: #65716a;
  line-height: 1.7;
}

.mark,
.done-check {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #185b45;
  font-size: 24px;
  font-weight: 760;
}

.done-check {
  background: #16845d;
}

.primary-action,
.submit-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: #185b45;
  color: #fff;
  font-weight: 720;
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.primary-action {
  padding: 0 24px;
}

.submit-button {
  width: 100%;
  margin: 6px 0 28px;
}

.primary-action:hover,
.submit-button:hover:not(:disabled) {
  background: #124a38;
  transform: translateY(-1px);
}

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

.vote-form {
  display: grid;
  gap: 18px;
}

.form-section {
  padding: 20px 0;
  border-top: 1px solid rgba(31, 39, 35, 0.12);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading span {
  color: #65716a;
  font-size: 13px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: #2b362f;
  font-size: 14px;
  font-weight: 680;
}

.doctor-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.doctor-row {
  display: grid;
  min-height: 46px;
  min-width: 0;
  align-items: center;
  justify-items: center;
  gap: 3px;
  border: 1px solid rgba(31, 39, 35, 0.12);
  border-radius: 8px;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.68);
  color: #1f2723;
  text-align: center;
  transition: border 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.doctor-row:hover,
.doctor-row.selected {
  border-color: #185b45;
  background: rgba(24, 91, 69, 0.08);
}

.doctor-row.selected {
  transform: translateX(2px);
}

.doctor-row small {
  max-width: 100%;
  color: #65716a;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doctor-row span {
  max-width: 100%;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-text,
.error-text {
  color: #9b3b2d;
  line-height: 1.6;
}

.empty-text {
  padding: 12px 0;
}

.error-text {
  margin-top: -2px;
}

.segmented-field + .segmented-field {
  margin-top: 18px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.segment-button {
  min-height: 46px;
  border: 1px solid rgba(31, 39, 35, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #1f2723;
  font-weight: 660;
  transition: border 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.segment-button:hover,
.segment-button.active {
  border-color: #185b45;
  background: #185b45;
  color: #fff;
}

.segment-button.active {
  transform: translateY(-1px);
}

.loader,
.mini-loader {
  border-radius: 50%;
  border: 2px solid rgba(24, 91, 69, 0.16);
  border-top-color: #185b45;
  animation: spin 0.76s linear infinite;
}

.loader {
  width: 34px;
  height: 34px;
}

.mini-loader {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 460px) {
  .app-shell {
    padding: 16px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
