:root {
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #616161;
  --brand: #ff4081; /* pink */
  --brand-hover: #e2336e;
  --accent: #00bcd4; /* cyan */
  --accent-2: #ffc107; /* amber */
  --ok: #2e7d32;
  --warn: #c62828;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
}

.container { max-width: 980px; margin: 0 auto; padding: 24px 16px 64px; }

header {
  background: transparent;
  color: var(--text);
  padding: 0;
  border-bottom: 0;
}
header .container { display: flex; align-items: center; justify-content: center; padding: 4px 0; margin-top: 20px; }
header h1 { margin: 0; font-size: 1.6rem; letter-spacing: 0.02em; }
header a { color: var(--text); text-decoration: none; opacity: 0.9; }
header a:hover { opacity: 1; color: var(--brand); }
header nav { display: flex; gap: 12px; flex-wrap: wrap; }
/* Brand logo */
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo { height: 32px; width: auto; display: block; }
.brand .brand-text { display: none; }

.hero { text-align: center; padding: 32px 0 8px; }
.hero h2 { font-size: clamp(1.6rem, 5vw, 2rem); margin: 8px 0; }
.hero p { color: var(--muted); margin: 8px 0 0; }

.card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid #eaeaea;
  padding: 20px;
  margin: 24px 0;
}

.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 860px) { .grid { grid-template-columns: 1fr 1fr; } }

textarea, input[type=text], input[type=tel] {
  width: 100%;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font: inherit;
  padding: 10px 12px;
}
textarea { height: 160px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background:#fff; border:4px dotted #e0e0e0; border-radius:12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Focused editor */
.editor { max-width: 760px; margin: 0 auto; }
.textarea-large { height: auto; font-size: 16px; line-height: 1.6; min-height: 40vh; overflow-y: hidden; resize: none; }
.input-big { font-size: 28px; padding: 14px 16px; text-align: center; letter-spacing: 0.02em; }
.btn-huge { font-size: 1.4rem; padding: 14px 24px; width: 100%; max-width: 480px; display: block; margin: 10px auto; }
/* Copy link small button */
.btn-copy-link { display: inline-block; margin-left: 8px; padding: 10px 14px; border: 1px solid #e0e0e0; border-radius: 999px; background: #fff; color: var(--brand); font-weight: 700; cursor: pointer; }
.btn-copy-link:hover { border-color: var(--brand); }
/* Underlined link style for copy action */
.link-copy { display: inline-block; margin-left: 12px; color: var(--brand); text-decoration: underline; font-weight: 700; }
.link-copy:hover { opacity: .85; }
/* Big fax number display */
.fax-hero { width: 100%; max-width: 100%; padding: 0 8px; margin: 0 auto 8px; text-align: center; }
.fax-top { max-width: 100%; margin: 6px auto 4px; text-align: center; }
.fax-echo {
  width: 100%;
  text-align: center;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: 0;
  /* even larger than input */
  font-size: clamp(40px, 5.67vw, 106px);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fax-display {
  width: 100%;
  font-size: clamp(36px, 5.33vw, 87px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.0;
  color: var(--brand);
  background: transparent;
  border: none;
  border-bottom: 10px solid var(--brand);
  border-radius: 0;
  padding: 0 8px 8px;
  text-align: center;
  letter-spacing: 0;
  outline: none;
  caret-color: var(--brand);
}
.fax-display::placeholder { color: #ff77a6; opacity: 0.6; }
/* Drag & Drop */
.dropzone {
  margin-top: 8px;
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}
.dropzone.hover { border-color: var(--brand); color: var(--text); background: #fff; }
.preview { margin-top: 8px; text-align: center; }
.preview img { max-width: 100%; max-height: 220px; border: 1px solid #e0e0e0; border-radius: 8px; }

/* Sticky preview bottom */
.sticky-preview { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #e0e0e0; padding: 10px 0; z-index: 10; }
.sticky-preview .preview-area { max-height: 30vh; overflow: auto; }
.spacer-preview { height: 180px; }

/* Temporarily hide all previews */
.preview, .sticky-preview, #preview-spacer { display: none !important; }

button.primary {
  background: var(--brand);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}
button.primary:hover { background: var(--brand-hover); }
button.primary:disabled { opacity: 0.6; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 0.9rem; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }

footer { text-align: center; color: var(--muted); padding: 24px 0 40px; border-top: 1px solid #e0e0e0; }

pre.code-block { background:#fafafa; border: 1px dashed #e0e0e0; padding: 12px; border-radius: 8px; overflow:auto; }

.status { background: #fff8e1; border: 1px solid #ffe082; padding: 16px; border-radius: 8px; }

a.button { display: inline-block; background: var(--card); border: 1px solid #e0e0e0; color: var(--text); padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.button.secondary { background: #f5f5f5; border: 1px solid #e0e0e0; color: var(--text); }

/* Sticky CTA */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  padding: 12px 0;
}
.sticky-cta .container { display: flex; align-items: center; justify-content: space-between; }
.cta-button { font-size: 1.1rem; padding: 12px 20px; }
.spacer-bottom { height: 72px; }

/* Responsive tweaks */
@media (max-width: 880px) {
  .container { padding: 20px 12px 56px; }
}
@media (max-width: 640px) {
  header .container { flex-direction: column; align-items: flex-start; gap: 6px 0; }
  .brand .logo { height: 24px; }
  .textarea-large { height: 300px; min-height: 35vh; }
  .btn-huge { max-width: none; }
  .input-big { font-size: clamp(20px, 6vw, 28px); }
  .preview img { max-height: 160px; }
  .spacer-preview { height: 140px; }
}
@media (max-width: 400px) {
  .input-big { font-size: clamp(18px, 7vw, 24px); }
}
