:root {
  --green-950: #2a130d;
  --green-900: #4b1f14;
  --green-800: #78341f;
  --green-700: #a34f2c;
  --green-100: #f2dfcf;
  --green-050: #fbf3ea;
  --gold-500: #d19a54;
  --gold-300: #efd1a4;
  --ink-900: #2b1b14;
  --ink-700: #5a3a2d;
  --ink-500: #8b6d5e;
  --surface: #ffffff;
  --surface-soft: #fffaf4;
  --surface-tint: #f8eadc;
  --border: #ead5c0;
  --border-strong: #d4ad8b;
  --shadow-soft: 0 10px 30px rgba(75, 31, 20, 0.1);
  --shadow-card: 0 24px 60px rgba(75, 31, 20, 0.15);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 36px;
}

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

html {
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 232, 187, 0.42), transparent 28%),
    linear-gradient(100deg, rgba(255, 255, 255, 0.22) 0%, transparent 18%, rgba(255, 255, 255, 0.16) 36%, transparent 58%),
    repeating-linear-gradient(90deg, rgba(124, 67, 35, 0.08) 0 2px, transparent 2px 116px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, #f7e7d6 0%, #fff8ef 30%, #f3ddc7 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink-900);
  background: transparent;
  -webkit-font-smoothing: antialiased;
}

input,
select,
textarea,
button {
  font: inherit;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 229, 184, 0.26), transparent 26%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, transparent 22%, rgba(255, 255, 255, 0.1) 44%, transparent 68%),
    repeating-linear-gradient(90deg, rgba(255, 218, 171, 0.1) 0 2px, transparent 2px 104px),
    linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 100%);
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 238, 210, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 38%, rgba(0, 0, 0, 0.1));
  background-size: 112px 100%, 100% 100%;
  opacity: 0.28;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 10%, rgba(255, 255, 255, 0.18) 26%, transparent 42%),
    linear-gradient(180deg, transparent 0%, rgba(255, 205, 149, 0.12) 78%, rgba(255, 255, 255, 0.18) 100%);
  mix-blend-mode: screen;
  opacity: 0.45;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.18;
  pointer-events: none;
}

.hero-glow-left {
  top: -160px;
  left: -90px;
  background: #fff7db;
}

.hero-glow-right {
  right: -120px;
  top: -100px;
  background: #d88456;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 16px 138px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: end;
}

.hero-copy {
  max-width: 760px;
}

.hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.hero-kicker,
.hero-overline,
.section-kicker,
.hero-panel-kicker,
.card-label {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-kicker {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
}

.hero-user {
  position: absolute;
  top: 54px;
  right: 22px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-user-copy {
  display: grid;
  gap: 2px;
  text-align: right;
}

.hero-user-copy strong,
.hero-user-copy span {
  display: block;
}

.hero-user-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.hero-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #fff1e2 100%);
  color: var(--green-900);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(75, 31, 20, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.hero-login-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(75, 31, 20, 0.26);
  filter: saturate(1.03);
}

.hero-login-link-secondary {
  min-height: 40px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

[hidden] {
  display: none !important;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.16);
}

.hero-brand-copy {
  min-width: 0;
}

.hero-title-row {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.hero-overline {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.hero-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 3.55vw, 3.95rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  color: #fff;
}

.hero-title-ball {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0.95;
}

.hero-sub {
  margin: 22px 0 0;
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.84);
}

.hero-tags {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
}

.hero-panel {
  align-self: stretch;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
}

.hero-panel-kicker {
  margin-bottom: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
}

.hero-panel-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.45;
}

.hero-panel-step + .hero-panel-step {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--gold-300);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-rule {
  position: relative;
  z-index: 1;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-500) 0%, var(--gold-300) 34%, transparent 100%);
}

.shell {
  max-width: 1180px;
  margin: -84px auto 0;
  padding: 0 16px 56px;
  position: relative;
  z-index: 2;
}

.form-shell {
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.45), transparent 34%),
    repeating-linear-gradient(90deg, rgba(163, 79, 44, 0.035) 0 1px, transparent 1px 86px),
    linear-gradient(180deg, rgba(255, 250, 244, 0.98) 0%, #fff 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 32px;
}

.auth-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 32px 36px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.46), transparent 36%),
    repeating-linear-gradient(90deg, rgba(163, 79, 44, 0.035) 0 1px, transparent 1px 86px),
    linear-gradient(180deg, rgba(255, 250, 244, 0.98) 0%, #fff 100%);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.auth-card .section-kicker {
  display: inline-block;
}

.auth-card-title {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1.08;
  color: var(--green-950);
}

.auth-card-copy {
  margin: 14px auto 0;
  max-width: 60ch;
  color: var(--ink-700);
  line-height: 1.7;
}

.auth-card-actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ms-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 0 36px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--green-800) 0%, var(--green-900) 100%);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow:
    0 22px 40px rgba(75, 31, 20, 0.3),
    0 2px 0 rgba(255, 255, 255, 0.1) inset;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  position: relative;
}

.ms-login-btn::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 24px;
  border: 2px solid rgba(163, 79, 44, 0.22);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.ms-login-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 28px 48px rgba(75, 31, 20, 0.34),
    0 2px 0 rgba(255, 255, 255, 0.12) inset;
  filter: saturate(1.08);
}

.ms-login-btn:hover::after {
  opacity: 1;
  transform: scale(1.01);
}

.ms-login-btn:active {
  transform: translateY(0);
}

.ms-login-btn:focus-visible {
  outline: 3px solid rgba(163, 79, 44, 0.55);
  outline-offset: 3px;
}

.ms-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.ms-login-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ms-login-text {
  line-height: 1;
}

.ms-login-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-500);
}

.form-shell-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.section-kicker {
  margin-bottom: 10px;
  color: #8f4b35;
}

.form-shell-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--green-950);
}

.form-shell-subtitle {
  margin: 12px 0 0;
  max-width: 740px;
  color: var(--ink-700);
  line-height: 1.7;
  font-size: 0.98rem;
}

.form-shell-meta {
  display: grid;
  gap: 12px;
  justify-items: end;
  align-content: start;
}

.form-shell-note {
  margin: 0;
  max-width: 280px;
  text-align: right;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink-500);
}

.field-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.72) 38%, rgba(190, 199, 207, 0.44) 48%, transparent 62%),
    linear-gradient(180deg, #f5f6f7 0%, #e4e8eb 100%);
  border: 1px solid #c0281d;
  color: var(--ink-700);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88) inset,
    0 8px 16px rgba(192, 40, 29, 0.08);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.legend-sample {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(190, 199, 207, 0.48) 48%, transparent 68%),
    #d8dde2;
  border: 1px solid #c0281d;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    0 0 0 2px rgba(192, 40, 29, 0.08);
}

.form-stack {
  display: grid;
  gap: 22px;
}

.card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.52) 0%, transparent 32%),
    repeating-linear-gradient(90deg, rgba(163, 79, 44, 0.035) 0 1px, transparent 1px 78px),
    linear-gradient(180deg, rgba(251, 243, 234, 0.95) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.card-label {
  color: #8f4b35;
}

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

.span-2 {
  grid-column: span 2;
}

.compact-grid {
  margin-top: 2px;
}

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

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-700);
}

.helper-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-500);
}

.field-note {
  font-size: 0.76rem;
  line-height: 1.4;
}

.field-note-warning {
  color: #c0281d;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background-color 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8b9d91;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #d4ad8b;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow:
    0 0 0 4px rgba(163, 79, 44, 0.14),
    0 10px 18px rgba(120, 52, 31, 0.1);
}

.readonly-field {
  background: linear-gradient(180deg, #fff7ee 0%, #f5e5d6 100%);
  color: var(--ink-700);
}

.critical input,
.critical select {
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.72) 35%, rgba(190, 199, 207, 0.34) 48%, transparent 64%),
    linear-gradient(180deg, #f7f8f9 0%, #ffffff 100%);
  border-color: #c0281d;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.critical input:focus,
.critical select:focus {
  border-color: #c0281d;
  box-shadow:
    0 0 0 3px rgba(192, 40, 29, 0.12),
    0 10px 18px rgba(192, 40, 29, 0.08),
    0 0 18px rgba(190, 199, 207, 0.22);
}

.field-error {
  display: none;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #c0281d;
  letter-spacing: 0.01em;
}

.field.is-invalid .field-error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: fieldErrorIn 0.18s ease-out;
}

.field.is-invalid .field-error::before {
  content: "\26A0";
  font-size: 0.95rem;
  line-height: 1;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: #c0281d !important;
  background: linear-gradient(180deg, #fff4f3 0%, #fffaf9 100%) !important;
  box-shadow: 0 0 0 3px rgba(192, 40, 29, 0.12);
}

.field.is-invalid input:focus,
.field.is-invalid select:focus,
.field.is-invalid textarea:focus {
  border-color: #a31f17 !important;
  box-shadow: 0 0 0 4px rgba(192, 40, 29, 0.18);
}

@keyframes fieldErrorIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.tile-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.alternate-toggle-row {
  grid-template-columns: minmax(260px, 360px);
}

.alternate-locked-tile {
  cursor: not-allowed;
  opacity: 0.72;
}

.alternate-locked-tile:hover {
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(224, 184, 54, 0.3);
}

.alternate-panel {
  margin-top: 16px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(163, 79, 44, 0.16);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(255, 247, 238, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.alternate-panel-copy {
  margin: 0;
  color: var(--ink-700);
  line-height: 1.55;
}

.alternate-subsection {
  display: grid;
  gap: 12px;
}

.alternate-subsection-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green-900);
}

.tile-row-single {
  margin-top: 12px;
  grid-template-columns: minmax(210px, 280px);
}

.logo-options-panel {
  margin-top: 16px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(163, 79, 44, 0.16);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(255, 247, 238, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.logo-options-title,
.logo-type-heading {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green-900);
}

.logo-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.logo-type-column {
  display: grid;
  gap: 10px;
}

.logo-type-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(129, 139, 148, 0.24);
  background: rgba(255, 255, 255, 0.92);
}

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

.logo-type-panel .field {
  gap: 5px;
}

.logo-type-panel .field label {
  font-size: 0.78rem;
}

.logo-type-panel input {
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 12px;
}

.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-700);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.tile:hover {
  transform: translateY(-1px);
  border-color: #d4ad8b;
  background: #fff8ef;
  box-shadow: 0 10px 20px rgba(75, 31, 20, 0.08);
}

.tile:has(input:checked) {
  border-color: rgba(163, 79, 44, 0.5);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(242, 223, 207, 0.92) 0%, rgba(255, 247, 238, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(163, 79, 44, 0.2),
    0 12px 22px rgba(75, 31, 20, 0.1);
  color: var(--green-900);
}

.tile-logo-trigger {
  border-color: rgba(224, 184, 54, 0.58);
  background: linear-gradient(180deg, rgba(255, 251, 214, 0.98) 0%, rgba(255, 254, 239, 0.99) 100%);
  color: #7b6200;
  box-shadow: inset 0 0 0 1px rgba(224, 184, 54, 0.16);
}

.tile-logo-trigger:hover {
  border-color: rgba(224, 184, 54, 0.82);
  background: linear-gradient(180deg, rgba(255, 246, 181, 0.99) 0%, rgba(255, 252, 222, 0.99) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(224, 184, 54, 0.22),
    0 10px 20px rgba(123, 98, 0, 0.08);
}

.tile-logo-trigger:has(input:checked) {
  border-color: rgba(224, 184, 54, 0.95);
  background: linear-gradient(180deg, rgba(255, 233, 122, 0.99) 0%, rgba(255, 247, 194, 0.99) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(224, 184, 54, 0.3),
    0 12px 22px rgba(123, 98, 0, 0.12);
  color: #6a5400;
}

.tile input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green-700);
  flex-shrink: 0;
}

.field-tile {
  min-height: 48px;
  padding-block: 0;
}

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

.search-row button,
.btn-primary,
.btn-secondary {
  border: 0;
  cursor: pointer;
}

.search-row button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, #a34f2c 0%, #78341f 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(75, 31, 20, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.search-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(75, 31, 20, 0.22);
  filter: saturate(1.05);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.project-create-status {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: min(360px, 100%);
}

.project-loading {
  width: min(360px, 100%);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(212, 173, 139, 0.32);
  box-shadow: inset 0 0 0 1px rgba(75, 31, 20, 0.12);
}

.project-loading-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), transparent 45%),
    linear-gradient(90deg, var(--green-700), var(--green-900));
  box-shadow: 0 6px 12px rgba(75, 31, 20, 0.18);
  transition: width 0.45s ease;
}

.crm-sync-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: -4px;
}

.crm-sync-header .card-label {
  margin: 0;
  flex: 0 0 auto;
}

.crm-sync-header .status {
  margin-left: auto;
  text-align: right;
}

.crm-sync-inline-btn {
  width: 100%;
  margin-top: 4px;
}

.crm-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(129, 139, 148, 0.24);
  border-radius: 999px;
  background: rgba(247, 248, 249, 0.9);
}

.crm-mode-btn {
  min-height: 28px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-600);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.crm-mode-btn:hover {
  color: #704131;
  background: rgba(232, 235, 238, 0.9);
}

.crm-mode-btn.is-active {
  color: #fff;
  background: linear-gradient(180deg, var(--green-700) 0%, var(--green-900) 100%);
  box-shadow: 0 6px 14px rgba(75, 31, 20, 0.14);
}

.crm-mode-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.crm-create-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 0.76rem;
  font-weight: 700;
  color: #7a5417;
  cursor: pointer;
  white-space: nowrap;
}

.crm-create-toggle input[type="checkbox"] {
  width: 12px;
  height: 12px;
  min-height: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex: 0 0 12px;
  accent-color: #c8a65a;
  transform: translateY(1px);
}

.crm-create-toggle input[type="checkbox"]:hover,
.crm-create-toggle input[type="checkbox"]:focus {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.crm-create-toggle:hover {
  color: #9c7b2b;
}

.crm-create-panel {
  align-content: start;
}

.crm-confirm-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 166, 90, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8df 0%, #fffdf4 100%);
  box-shadow: 0 10px 22px rgba(200, 166, 90, 0.1);
}

.crm-confirm-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.crm-confirm-copy strong {
  color: #7d5a10;
  font-size: 0.92rem;
}

.crm-confirm-copy span {
  color: #8c6a1f;
  font-size: 0.86rem;
  line-height: 1.4;
}

.crm-confirm-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.previous-projects {
  margin-top: 22px;
  gap: 16px;
  padding: 20px 22px;
}

.pdf-preview {
  margin-top: 22px;
  gap: 16px;
  padding: 20px 22px;
}

.pdf-preview-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.pdf-preview-title {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.1;
  color: var(--green-950);
}

.pdf-preview-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-500);
  font-size: 0.9rem;
}

.pdf-email-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pdf-email-recipient {
  min-width: 280px;
}

.pdf-email-send {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(163, 79, 44, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(236, 239, 242, 0.96) 0%, rgba(250, 250, 250, 1) 100%);
  color: var(--green-900);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.pdf-email-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(75, 31, 20, 0.1);
  filter: saturate(1.03);
}

.pdf-email-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pdf-email-status {
  margin: 0;
  font-size: 0.88rem;
  color: var(--green-800);
}

.pdf-email-status.is-error {
  color: #9d2f2f;
}

.pdf-page-indicator {
  min-width: 60px;
  text-align: center;
  font-weight: 700;
  color: var(--green-900);
}

.pdf-preview-link {
  color: var(--green-800);
  font-weight: 700;
  text-decoration: none;
}

.pdf-preview-link:hover {
  text-decoration: underline;
}

.pdf-preview-shell {
  position: relative;
  overflow: hidden;
  min-height: 760px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(246, 247, 248, 0.86) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: var(--shadow-soft);
}

.pdf-preview-frame {
  width: 100%;
  height: 760px;
  border: 0;
  background: #fff;
}

.pdf-preview-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(75, 31, 20, 0.88);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 0 12px 24px rgba(5, 24, 14, 0.18);
}

.pdf-preview-nav:hover:not(:disabled) {
  filter: saturate(1.08);
}

.pdf-preview-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pdf-preview-nav-left {
  left: 14px;
}

.pdf-preview-nav-right {
  right: 14px;
}

.previous-projects-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.previous-projects-title {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.1;
  color: var(--green-950);
}

.previous-projects-caption {
  margin: 0;
  max-width: 280px;
  text-align: right;
  color: var(--ink-500);
  font-size: 0.86rem;
  line-height: 1.5;
}

.previous-projects-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}

.my-projects {
  margin-top: 22px;
}

.my-projects .previous-projects-caption {
  max-width: 320px;
}

.my-projects-body {
  display: grid;
  gap: 14px;
}

.history-detail-panel {
  min-height: auto;
}

.history-chart,
.history-detail {
  display: grid;
  gap: 10px;
}

.history-chart {
  align-content: start;
}

.history-bar {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(110px, 1.7fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-700);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.history-bar:hover {
  transform: translateY(-1px);
  border-color: #d4ad8b;
  box-shadow: 0 10px 18px rgba(75, 31, 20, 0.1);
}

.history-bar.is-active {
  border-color: rgba(163, 79, 44, 0.42);
  background: linear-gradient(180deg, rgba(247, 248, 249, 0.94) 0%, rgba(255, 250, 244, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(163, 79, 44, 0.16),
    0 12px 20px rgba(75, 31, 20, 0.1);
}

.history-bar-label {
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
}

.history-bar-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(163, 79, 44, 0.09);
}

.history-bar-fill {
  display: block;
  height: 100%;
  min-width: 10px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-700) 0%, var(--green-800) 100%);
}

.history-bar-count,
.history-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green-900);
}

.history-detail {
  min-height: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(247, 248, 249, 0.9) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid var(--border);
}

.history-detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.history-detail-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8f4b35;
}

.history-detail-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--green-950);
}

.history-list {
  max-height: 420px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(225, 216, 207, 0.95);
  background: rgba(255, 255, 255, 0.95);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.history-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f4f5f6 0%, #eceff1 100%);
  border-bottom: 1px solid rgba(225, 216, 207, 0.95);
  color: #704131;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.history-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(225, 216, 207, 0.9);
  color: var(--ink-700);
  vertical-align: top;
}

.history-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-table tbody td:first-child {
  font-weight: 700;
  color: var(--ink-900);
}

.history-table-link {
  white-space: nowrap;
}

.history-table-link a {
  color: var(--green-800);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.history-table-link a:hover {
  text-decoration: underline;
}

.history-ticket-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  min-width: 180px;
  white-space: normal;
}

.history-ticket-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(163, 79, 44, 0.09);
  color: var(--green-800);
  font-size: 0.77rem;
  font-weight: 700;
  width: fit-content;
}

.history-ticket-badge.is-empty {
  background: rgba(129, 139, 148, 0.14);
  color: var(--ink-700);
}

.history-ticket-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8ef 0%, #f5e5d6 100%);
  box-shadow: inset 0 0 0 1px rgba(163, 79, 44, 0.18);
  color: var(--green-900);
  text-align: left;
  cursor: pointer;
}

.history-ticket-switch:disabled {
  opacity: 0.72;
  cursor: wait;
}

.history-ticket-switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(129, 139, 148, 0.34);
  transition: background 0.16s ease;
}

.history-ticket-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(24, 38, 28, 0.18);
  transition: transform 0.16s ease;
}

.history-ticket-switch.is-open .history-ticket-switch-track {
  background: linear-gradient(90deg, var(--green-700) 0%, var(--green-800) 100%);
}

.history-ticket-switch.is-open .history-ticket-switch-thumb {
  transform: translateX(20px);
}

.history-ticket-switch-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.history-ticket-switch-label {
  font-size: 0.8rem;
  font-weight: 800;
}

.history-ticket-switch-subject {
  color: var(--ink-500);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: normal;
}

.history-ticket-note {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(251, 243, 234, 0.92);
  border: 1px solid rgba(225, 216, 207, 0.95);
}

.history-ticket-note-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.92fr);
  gap: 10px;
  align-items: start;
}

.history-note-row td {
  padding: 0 12px 14px;
  border-bottom: 1px solid rgba(225, 216, 207, 0.9);
  background: rgba(248, 251, 247, 0.48);
}

.history-note-row:last-child td {
  border-bottom: 0;
}

.history-ticket-detail {
  display: grid;
  gap: 10px;
}

.history-ticket-note-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8f4b35;
}

.history-ticket-note-input {
  width: 100%;
  min-height: 82px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(191, 208, 188, 0.95);
  background: #fff;
  color: var(--ink-900);
  resize: vertical;
}

.history-ticket-note-input:focus {
  outline: none;
  border-color: rgba(163, 79, 44, 0.44);
  box-shadow: 0 0 0 3px rgba(163, 79, 44, 0.14);
}

.history-ticket-note-field {
  display: grid;
  gap: 4px;
}

.history-ticket-note-field-notify {
  align-content: start;
}

.history-ticket-note-assignees {
  display: grid;
  gap: 6px;
}

.history-ticket-note-select-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8f4b35;
}

.history-ticket-note-select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(191, 208, 188, 0.95);
  background: #fff;
  color: var(--ink-900);
  font-size: 0.84rem;
  line-height: 1.25;
}

.history-ticket-note-select:focus {
  outline: none;
  border-color: rgba(163, 79, 44, 0.44);
  box-shadow: 0 0 0 3px rgba(163, 79, 44, 0.14);
}

.history-ticket-note-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.history-ticket-note-actions .btn-secondary {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.history-ticket-message {
  font-size: 0.74rem;
  color: #704131;
  line-height: 1.45;
  padding: 0 2px;
}

.history-ticket-message.is-error {
  color: #c0281d;
  font-weight: 600;
}

@media (max-width: 1080px) {
  .history-ticket-note-layout {
    grid-template-columns: 1fr;
  }
}

.btn-primary {
  min-height: 56px;
  padding: 0 30px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(135deg, var(--green-800) 0%, var(--green-900) 100%);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 30px rgba(75, 31, 20, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn-secondary {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8ef 0%, #f5e5d6 100%);
  color: var(--green-900);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(163, 79, 44, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 34px rgba(75, 31, 20, 0.26);
  filter: saturate(1.05);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(163, 79, 44, 0.24), 0 10px 20px rgba(75, 31, 20, 0.1);
}

.btn-primary:active,
.search-row button:active,
.btn-secondary:active {
  transform: translateY(0);
}

.status {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-500);
}

.status.is-error {
  color: #c0281d;
  font-weight: 600;
}

.status a {
  color: #704131;
  font-weight: 700;
  text-decoration: none;
}

.status a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--ink-500);
}

.site-footer {
  padding: 22px 20px 34px;
  text-align: center;
  color: var(--ink-500);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding-bottom: 120px;
  }

  .hero-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-user {
    position: static;
    margin: 14px 16px 0;
    justify-content: space-between;
  }

  .hero-user-copy {
    text-align: left;
  }

  .hero-panel {
    max-width: 620px;
  }

  .form-shell-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .form-shell-meta {
    justify-items: start;
  }

  .form-shell-note {
    text-align: left;
    max-width: none;
  }

  .previous-projects-body {
    grid-template-columns: 1fr;
  }

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

  .previous-projects-caption {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .hero-inner {
    padding: 34px 12px 106px;
    gap: 22px;
  }

  .hero-brand {
    align-items: flex-start;
    gap: 14px;
  }

  .hero-logo {
    width: 66px;
    height: 66px;
  }

  .hero-title-row {
    gap: 6px;
  }

  .hero-title-ball {
    width: 21px;
    height: 21px;
    margin-bottom: 3px;
  }

  .hero-sub {
    font-size: 0.97rem;
    line-height: 1.65;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tag {
    font-size: 0.8rem;
  }

  .shell {
    margin-top: -70px;
    padding: 0 10px 42px;
  }

  .form-shell {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .auth-card {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .form-shell-header {
    gap: 16px;
    padding-bottom: 22px;
    margin-bottom: 22px;
  }

  .form-stack {
    gap: 18px;
  }

  .card {
    padding: 18px 16px;
    gap: 16px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .span-2 {
    grid-column: span 1;
  }

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

  .logo-type-grid {
    grid-template-columns: 1fr;
  }

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

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .project-create-status,
  .project-loading {
    width: 100%;
    justify-items: stretch;
  }

  .previous-projects {
    margin-top: 18px;
    padding: 18px 16px;
  }

  .pdf-preview {
    margin-top: 18px;
    padding: 18px 16px;
  }

  .pdf-preview-meta {
    gap: 10px;
    flex-wrap: wrap;
  }

  .pdf-email-tools {
    width: 100%;
  }

  .pdf-email-recipient {
    min-width: 0;
  }

  .pdf-preview-shell {
    min-height: 540px;
  }

  .pdf-preview-frame {
    height: 540px;
  }

  .pdf-preview-nav {
    width: 38px;
    height: 38px;
  }

  .pdf-preview-nav-left {
    left: 10px;
  }

  .pdf-preview-nav-right {
    right: 10px;
  }

  .previous-projects-header {
    gap: 10px;
    padding-bottom: 12px;
  }

  .history-bar {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: start;
  }

  .history-bar-track {
    width: 100%;
  }

  .history-detail {
    padding: 14px;
  }

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

  .history-list {
    max-height: 360px;
  }

  .history-table {
    min-width: 540px;
  }

  .history-note-row td {
    padding: 0 10px 12px;
  }

  .history-ticket-note-layout {
    grid-template-columns: 1fr;
  }

  .previous-projects-body,
  .my-projects-body {
    grid-template-columns: 1fr;
  }

  .btn-primary {
    width: 100%;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.feedback-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 0 18px;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green-800) 0%, var(--green-900) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 18px 36px rgba(75, 31, 20, 0.32),
    0 0 0 4px rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.feedback-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 46px rgba(75, 31, 20, 0.38),
    0 0 0 4px rgba(255, 255, 255, 0.12);
  filter: saturate(1.08);
}

.feedback-fab:focus-visible {
  outline: 3px solid rgba(200, 166, 90, 0.6);
  outline-offset: 3px;
}

.feedback-fab svg {
  flex-shrink: 0;
}

.feedback-fab-label {
  line-height: 1;
}

.feedback-panel {
  position: fixed;
  bottom: 90px;
  right: 22px;
  z-index: 61;
  width: min(360px, calc(100vw - 44px));
  padding: 22px 22px 20px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px rgba(75, 31, 20, 0.3);
  animation: feedbackPanelIn 0.22s ease-out;
}

@keyframes feedbackPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.feedback-panel-title {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  color: var(--green-950);
}

.feedback-panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--green-050);
  color: var(--green-900);
  cursor: pointer;
  transition: background 0.16s ease;
}

.feedback-panel-close:hover {
  background: var(--green-100);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feedback-stars {
  border: 0;
  padding: 0;
  margin: 0;
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.feedback-stars input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feedback-stars label {
  cursor: pointer;
  color: #d9d9d9;
  transition: color 0.14s ease, transform 0.14s ease;
  line-height: 0;
}

.feedback-stars label:hover,
.feedback-stars label:hover ~ label,
.feedback-stars input:checked ~ label {
  color: var(--gold-500);
}

.feedback-stars label:hover {
  transform: scale(1.08);
}

.feedback-stars input:focus-visible + label {
  outline: 2px solid var(--green-700);
  outline-offset: 2px;
  border-radius: 4px;
}

.feedback-message-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-700);
}

.feedback-message {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-900);
  font: inherit;
  resize: vertical;
  min-height: 86px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.feedback-message:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(163, 79, 44, 0.16);
}

.feedback-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-form-status {
  font-size: 0.86rem;
  color: var(--ink-500);
}

.feedback-form-status.is-error {
  color: #b4301f;
}

.feedback-submit {
  min-height: 46px;
  padding: 0 22px;
  font-size: 0.92rem;
}

.feedback-history {
  margin-top: 28px;
}

.feedback-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.feedback-history-title {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  color: var(--green-950);
}

.feedback-history-stats {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--green-050);
  border: 1px solid var(--border);
}

.feedback-history-avg {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-900);
  line-height: 1;
}

.feedback-history-count {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-500);
}

.feedback-history-body {
  display: block;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.feedback-entries {
  display: grid;
  gap: 12px;
}

.feedback-entry {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, rgba(251, 243, 234, 0.68) 100%);
}

.feedback-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.feedback-entry-person {
  display: grid;
  gap: 2px;
}

.feedback-entry-person strong {
  color: var(--green-950);
}

.feedback-entry-meta {
  color: var(--ink-500);
  font-size: 0.84rem;
}

.feedback-star-row {
  display: inline-flex;
  gap: 2px;
  letter-spacing: 0.04em;
}

.feedback-star-icon {
  color: #d9d9d9;
  font-size: 1.05rem;
  line-height: 1;
}

.feedback-star-icon.is-filled {
  color: var(--gold-500);
}

.feedback-entry-message {
  margin: 0;
  color: var(--ink-700);
  line-height: 1.6;
}

.feedback-entry-footer {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--ink-500);
}

@media (max-width: 720px) {
  .feedback-fab {
    bottom: 16px;
    right: 16px;
    padding: 0 16px 0 14px;
  }

  .feedback-fab-label {
    display: none;
  }

  .feedback-panel {
    bottom: 80px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .feedback-history-header {
    align-items: flex-start;
  }

  .feedback-history-body {
    max-height: 240px;
  }
}

.email-draft {
  margin-top: 4px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, rgba(246, 250, 244, 0.55) 100%);
  display: grid;
  gap: 14px;
}

.email-draft-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.email-draft-title {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  color: var(--green-950);
}

.email-draft-reset {
  align-self: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--green-900);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.email-draft-reset:hover:not(:disabled) {
  background: var(--green-050);
  border-color: var(--border-strong);
}

.email-draft-reset:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.email-draft-field {
  display: grid;
  gap: 6px;
}

.email-draft-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.email-draft-input,
.email-draft-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-900);
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.email-draft-textarea {
  resize: vertical;
  min-height: 420px;
  line-height: 1.55;
  font-family: inherit;
}

.email-draft-input:focus,
.email-draft-textarea:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(163, 79, 44, 0.16);
}

.email-draft-input:disabled,
.email-draft-textarea:disabled {
  opacity: 0.7;
  background: #f5f6f7;
  cursor: not-allowed;
}

.email-draft-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--green-050);
  border: 1px dashed var(--border-strong);
  font-size: 0.88rem;
  color: var(--green-900);
  width: fit-content;
  max-width: 100%;
}

.email-draft-attachment-icon {
  font-size: 1rem;
  line-height: 1;
}

.email-draft-attachment-hint {
  color: var(--ink-500);
  font-weight: 500;
}

.email-draft-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.email-draft-actions .pdf-email-status {
  flex: 1 1 auto;
  text-align: left;
}

.email-draft-actions .pdf-email-send {
  min-height: 46px;
  padding: 0 26px;
}

@media (max-width: 720px) {
  .email-draft {
    padding: 18px;
  }

  .email-draft-header {
    align-items: flex-start;
  }

  .email-draft-actions {
    justify-content: stretch;
  }

  .email-draft-actions .pdf-email-send {
    width: 100%;
  }
}
