.fcee-invoice {
  --fcee-ink: #172033;
  --fcee-muted: #5a6778;
  --fcee-border: #cbd7df;
  --fcee-soft: #f3f7f9;
  --fcee-primary: #164e63;
  --fcee-primary-dark: #103b4b;
  --fcee-accent: #c8a646;
  color: var(--fcee-ink);
  font-family: inherit;
  margin: 2rem auto;
  max-width: 1120px;
}

.fcee-invoice *, .fcee-invoice *::before, .fcee-invoice *::after { box-sizing: border-box; }
.fcee-invoice__form { display: grid; gap: 1.25rem; }
.fcee-section { background: #fff; border: 1px solid var(--fcee-border); border-radius: 12px; box-shadow: 0 7px 24px rgba(23, 32, 51, .06); padding: clamp(1rem, 3vw, 1.65rem); }
.fcee-section__heading { align-items: flex-start; border-bottom: 1px solid #e3eaee; display: flex; gap: .8rem; margin-bottom: 1.2rem; padding-bottom: 1rem; }
.fcee-section__heading > span { align-items: center; background: var(--fcee-primary); border-radius: 999px; color: #fff; display: inline-flex; flex: 0 0 2rem; font-size: .88rem; font-weight: 700; height: 2rem; justify-content: center; }
.fcee-section__heading h3 { color: var(--fcee-ink); font-size: 1.16rem; line-height: 1.3; margin: 0 0 .2rem; }
.fcee-section__heading p { color: var(--fcee-muted); font-size: .92rem; margin: 0; }
.fcee-grid { display: grid; gap: 1rem; }
.fcee-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fcee-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fcee-grid--materials { grid-template-columns: minmax(0, 3fr) minmax(180px, 1fr); }
.fcee-field { min-width: 0; }
.fcee-field--wide { grid-column: 1 / -1; }
.fcee-field label { color: var(--fcee-ink); display: block; font-size: .88rem; font-weight: 650; margin: 0 0 .38rem; }
.fcee-field label > span[aria-hidden="true"] { color: #a52b2b; }
.fcee-optional { color: var(--fcee-muted); font-size: .76rem; font-weight: 500; margin-left: .3rem; }
.fcee-field input, .fcee-field select, .fcee-field textarea { appearance: none; background: #fff; border: 1px solid #aebdc6; border-radius: 7px; color: var(--fcee-ink); font: inherit; line-height: 1.35; margin: 0; min-height: 46px; padding: .65rem .75rem; width: 100%; }
.fcee-field select { background-image: linear-gradient(45deg, transparent 50%, #526778 50%), linear-gradient(135deg, #526778 50%, transparent 50%); background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px; background-repeat: no-repeat; background-size: 5px 5px, 5px 5px; padding-right: 2rem; }
.fcee-field textarea { resize: vertical; }
.fcee-field input:focus, .fcee-field select:focus, .fcee-field textarea:focus { border-color: var(--fcee-primary); box-shadow: 0 0 0 3px rgba(22, 78, 99, .16); outline: none; }
.fcee-field small { color: var(--fcee-muted); display: block; font-size: .78rem; margin-top: .35rem; }
.fcee-logo-preview { border: 1px solid var(--fcee-border); border-radius: 6px; display: block; margin-top: .7rem; max-height: 90px; max-width: 240px; object-fit: contain; padding: .4rem; }
.fcee-money-input { position: relative; }
.fcee-money-input > span { color: var(--fcee-muted); left: .8rem; pointer-events: none; position: absolute; top: 50%; transform: translateY(-50%); }
.fcee-money-input input { padding-left: 1.7rem; text-align: right; }
.fcee-session-list { display: grid; gap: .8rem; margin-bottom: 1rem; }
.fcee-session { background: var(--fcee-soft); border: 1px solid #d8e3e8; border-radius: 9px; padding: .9rem; position: relative; }
.fcee-session__number { color: var(--fcee-primary); font-size: .78rem; font-weight: 750; letter-spacing: .05em; margin-bottom: .6rem; text-transform: uppercase; }
.fcee-session__fields { align-items: end; display: grid; gap: .75rem; grid-template-columns: minmax(180px, 2fr) minmax(145px, 1fr) minmax(90px, .65fr) minmax(130px, .85fr) minmax(115px, .7fr); }
.fcee-session__total { padding: 0 .2rem .45rem; text-align: right; }
.fcee-session__total span { color: var(--fcee-muted); display: block; font-size: .76rem; }
.fcee-session__total strong { color: var(--fcee-primary); font-size: 1rem; }
.fcee-session__remove { background: transparent; border: 0; color: #9e2d2d; cursor: pointer; font: inherit; font-size: .78rem; padding: .35rem; position: absolute; right: .55rem; text-decoration: underline; top: .4rem; }
.fcee-session__remove:hover { color: #6f1515; }
.fcee-button { align-items: center; border: 1px solid transparent; border-radius: 7px; cursor: pointer; display: inline-flex; font: inherit; font-weight: 700; justify-content: center; min-height: 46px; padding: .68rem 1.15rem; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.fcee-button:hover { transform: translateY(-1px); }
.fcee-button:focus-visible { box-shadow: 0 0 0 3px rgba(22, 78, 99, .22); outline: 2px solid var(--fcee-primary); outline-offset: 2px; }
.fcee-button:disabled { cursor: wait; opacity: .58; transform: none; }
.fcee-button--primary { background: var(--fcee-primary); color: #fff; }
.fcee-button--primary:hover { background: var(--fcee-primary-dark); color: #fff; }
.fcee-button--secondary { background: #fff; border-color: var(--fcee-primary); color: var(--fcee-primary); }
.fcee-button--secondary:hover { background: #eaf2f5; color: var(--fcee-primary-dark); }
.fcee-total-panel { align-items: center; background: var(--fcee-primary); border-radius: 12px; color: #fff; display: grid; gap: 2rem; grid-template-columns: 1fr minmax(280px, 420px); padding: 1.25rem 1.5rem; }
.fcee-total-panel h3 { color: #fff; font-size: 1.25rem; margin: 0 0 .2rem; }
.fcee-total-panel p { color: rgba(255,255,255,.75); font-size: .85rem; margin: 0; }
.fcee-total-panel dl { margin: 0; }
.fcee-total-panel dl > div { display: flex; justify-content: space-between; padding: .25rem 0; }
.fcee-total-panel dt, .fcee-total-panel dd { margin: 0; }
.fcee-total-panel__grand { border-top: 1px solid rgba(255,255,255,.35); font-size: 1.2rem; font-weight: 800; margin-top: .35rem; padding-top: .7rem !important; }
.fcee-checkbox { align-items: flex-start; color: var(--fcee-ink); display: flex; font-size: .9rem; gap: .55rem; }
.fcee-checkbox input { height: 18px; margin: .1rem 0 0; width: 18px; }
.fcee-invoice__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; }
.fcee-invoice__messages { border-radius: 8px; display: none; padding: .8rem 1rem; }
.fcee-invoice__messages p { margin: 0; }
.fcee-invoice__messages ul { margin: .5rem 0 0 1.2rem; }
.fcee-invoice__messages--working, .fcee-invoice__messages--success, .fcee-invoice__messages--error { display: block; }
.fcee-invoice__messages--working { background: #edf4f7; border: 1px solid #b8ccd5; }
.fcee-invoice__messages--success { background: #edf8f0; border: 1px solid #9bc8a6; color: #215d31; }
.fcee-invoice__messages--error { background: #fff2f2; border: 1px solid #d9a0a0; color: #7a2020; }
.fcee-invoice__trap { height: 1px; left: -10000px; overflow: hidden; position: absolute; top: auto; width: 1px; }

@media (max-width: 900px) {
  .fcee-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fcee-session__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fcee-session__total { align-self: center; text-align: left; }
}

@media (max-width: 640px) {
  .fcee-grid--two, .fcee-grid--three, .fcee-grid--materials, .fcee-session__fields, .fcee-total-panel { grid-template-columns: 1fr; }
  .fcee-invoice__actions { align-items: stretch; flex-direction: column; }
  .fcee-invoice__actions .fcee-button { width: 100%; }
  .fcee-session__total { border-top: 1px solid #d4dfe5; padding-top: .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fcee-button { transition: none; }
}
