:root {
  --tacom-red: #b42318;
  --tacom-red-dark: #8f1d14;
  --tacom-red-soft: #fff3f1;
  --tacom-ink: #181818;
  --tacom-muted: #646464;
  --tacom-line: #dedede;
  --tacom-surface: #ffffff;
  --tacom-radius: 10px;
}

.tacom-ordering-notice {
  align-items: flex-start;
  background: var(--tacom-red-soft);
  border: 1px solid #f0b8b2;
  border-left: 5px solid var(--tacom-red);
  border-radius: 6px;
  clear: both;
  color: #3c1916;
  display: flex;
  gap: 15px;
  margin: 0 0 32px;
  padding: 18px 20px;
  width: 100%;
}

.tacom-ordering-notice__icon {
  align-items: center;
  background: var(--tacom-red);
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex: 0 0 28px;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  line-height: 1;
}

.tacom-ordering-notice__content {
  display: grid;
  gap: 4px;
  line-height: 1.5;
}

.tacom-ordering-notice__content > strong { font-size: 16px; }
.tacom-ordering-notice__contacts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 7px; }
.tacom-ordering-notice__contacts a { color: var(--tacom-red-dark); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tacom-ordering-notice__contacts a:hover { color: #5d120d; }

.tacom-stamp {
  background: #fafafa;
  border: 1px solid var(--tacom-line);
  border-radius: var(--tacom-radius);
  clear: both;
  color: var(--tacom-ink);
  margin: 24px 0;
  padding: 24px;
}

.tacom-stamp *, .tacom-stamp-modal * { box-sizing: border-box; }
.tacom-stamp__heading { align-items: flex-start; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 20px; }
.tacom-stamp__heading h2 { font-size: 25px; line-height: 1.15; margin: 0 0 7px; }
.tacom-stamp__heading p:not(.tacom-stamp__eyebrow) { color: var(--tacom-muted); margin: 0; }
.tacom-stamp__eyebrow { color: var(--tacom-red); font-size: 11px; font-weight: 800; letter-spacing: .11em; margin: 0 0 6px; text-transform: uppercase; }
.tacom-stamp__size { background: #111; border-radius: 999px; color: #fff; flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 7px 12px; white-space: nowrap; }

.tacom-stamp__methods { display: grid; gap: 10px; }
.tacom-stamp__method { align-items: center; background: #fff; border: 1px solid var(--tacom-line); border-radius: 8px; cursor: pointer; display: flex; gap: 13px; margin: 0; min-height: 70px; padding: 13px 15px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.tacom-stamp__method:hover { border-color: #b9b9b9; }
.tacom-stamp__method.is-selected { background: #fff8f7; border-color: var(--tacom-red); box-shadow: 0 0 0 1px var(--tacom-red); }
.tacom-stamp__method input { accent-color: var(--tacom-red); flex: 0 0 auto; height: 18px; margin: 0; width: 18px; }
.tacom-stamp__method-marker { align-items: center; background: #efefef; border-radius: 50%; display: flex; flex: 0 0 30px; font-size: 12px; font-weight: 800; height: 30px; justify-content: center; }
.tacom-stamp__method.is-selected .tacom-stamp__method-marker { background: var(--tacom-red); color: #fff; }
.tacom-stamp__method > span:last-child { display: grid; gap: 2px; }
.tacom-stamp__method strong { font-size: 15px; line-height: 1.3; }
.tacom-stamp__method small { color: var(--tacom-muted); font-size: 12px; font-weight: 400; }
.tacom-stamp__method small b { color: var(--tacom-red); }

.tacom-stamp__panel { background: #fff; border: 1px solid var(--tacom-line); border-radius: 8px; margin-top: 14px; padding: 18px; }
.tacom-stamp__selection { align-items: center; display: flex; gap: 18px; justify-content: space-between; }
.tacom-stamp__selection > div { display: grid; gap: 3px; }
.tacom-stamp__selection span { color: var(--tacom-muted); font-size: 13px; }
.tacom-stamp__selection.is-complete { border-left: 3px solid #18864b; padding-left: 12px; }
.tacom-stamp__panel .button.alt, .tacom-editor__footer .button.alt { background: var(--tacom-red); border-color: var(--tacom-red); color: #fff; }
.tacom-stamp__panel .button.alt:hover, .tacom-editor__footer .button.alt:hover { background: var(--tacom-red-dark); border-color: var(--tacom-red-dark); }

.tacom-stamp__upload { align-items: center; border: 2px dashed #c9c9c9; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; justify-content: center; margin: 0; min-height: 150px; padding: 20px; text-align: center; }
.tacom-stamp__upload:hover { border-color: var(--tacom-red); background: var(--tacom-red-soft); }
.tacom-stamp__upload-icon { color: var(--tacom-red); font-size: 30px; line-height: 1; }
.tacom-stamp__upload input { margin-top: 10px; max-width: 100%; }
.tacom-stamp__upload-status { font-size: 13px; margin-top: 10px; min-height: 20px; }
.tacom-stamp__upload-status.is-loading { color: #6b5b00; }
.tacom-stamp__upload-status.is-success { color: #08783e; font-weight: 700; }
.tacom-stamp__upload-status.is-error, .tacom-stamp__error { color: var(--tacom-red-dark); }
.tacom-stamp__help { color: var(--tacom-muted); font-size: 13px; margin: 5px 0 10px; }
.tacom-stamp textarea { border: 1px solid #bbb; border-radius: 6px; min-height: 135px; padding: 12px; resize: vertical; width: 100%; }
.tacom-stamp__error { background: var(--tacom-red-soft); border-left: 4px solid var(--tacom-red); font-size: 13px; font-weight: 700; margin-top: 14px; padding: 11px 13px; }

.tacom-stamp-modal[hidden] { display: none !important; }
.tacom-stamp-modal { inset: 0; position: fixed; z-index: 999999; }
.tacom-stamp-modal__backdrop { background: rgba(15, 15, 15, .72); inset: 0; position: absolute; }
.tacom-stamp-modal__dialog { background: #fff; border-radius: 12px; box-shadow: 0 24px 80px rgba(0,0,0,.28); display: flex; flex-direction: column; inset: 3vh max(18px, calc((100vw - 1240px) / 2)); max-height: 94vh; overflow: hidden; position: absolute; }
.tacom-stamp-modal__header { align-items: center; border-bottom: 1px solid var(--tacom-line); display: flex; justify-content: space-between; padding: 18px 24px; }
.tacom-stamp-modal__header h2 { font-size: 24px; line-height: 1.2; margin: 0; }
.tacom-stamp-modal__close { align-items: center; appearance: none; background: #f0f0f0; border: 0; border-radius: 50%; color: #111; cursor: pointer; display: flex; font-size: 26px; height: 40px; justify-content: center; line-height: 1; padding: 0; width: 40px; }
.tacom-stamp-modal__close:hover { background: #dedede; }
.tacom-stamp-modal__body { flex: 1; overflow: auto; padding: 22px 24px 26px; }
.tacom-stamp-modal__intro { color: var(--tacom-muted); margin: 0 0 18px; }
.tacom-stamp-modal-open { overflow: hidden; }

.tacom-template-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; }
.tacom-template-filter { appearance: none; background: #fff; border: 1px solid var(--tacom-line); border-radius: 999px; color: #333; cursor: pointer; font-size: 12px; font-weight: 700; min-height: 36px; padding: 7px 13px; }
.tacom-template-filter:hover, .tacom-template-filter.is-active { background: var(--tacom-red); border-color: var(--tacom-red); color: #fff; }
.tacom-template-empty { background: #f6f6f6; border: 1px dashed #bbb; border-radius: 8px; color: var(--tacom-muted); padding: 18px; text-align: center; }
.tacom-template-card__compatibility { color: var(--tacom-muted); font-size: 10px; }

.tacom-template-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tacom-template-card { appearance: none; background: #fff; border: 1px solid var(--tacom-line); border-radius: 9px; color: var(--tacom-ink); cursor: pointer; display: grid; gap: 12px; padding: 14px; text-align: left; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tacom-template-card:hover, .tacom-template-card:focus-visible { border-color: var(--tacom-red); box-shadow: 0 8px 24px rgba(0,0,0,.1); outline: none; transform: translateY(-2px); }
.tacom-template-card__preview { align-items: center; background: #f8f8f8; display: flex; min-height: 90px; overflow: hidden; padding: 10px; width: 100%; }
.tacom-template-card__preview svg { display: block; height: auto; max-height: 115px; width: 100%; }
.tacom-template-card__meta { display: grid; gap: 2px; }
.tacom-template-card__meta small { color: var(--tacom-red); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tacom-template-card__meta strong { font-size: 14px; }

.tacom-editor { display: grid; gap: 18px; }
.tacom-editor__toolbar { background: #f6f6f6; border: 1px solid var(--tacom-line); border-radius: 10px; display: grid; gap: 9px; grid-template-columns: minmax(135px, .55fr) repeat(2, minmax(240px, 1fr)); padding: 12px; }
.tacom-editor__selection-context { align-content: center; background: #fff; border: 1px solid var(--tacom-line); border-left: 4px solid var(--tacom-red); border-radius: 7px; display: grid; grid-row: span 2; padding: 9px 11px; }
.tacom-editor__selection-context > span { color: var(--tacom-muted); font-size: 10px; text-transform: uppercase; }
.tacom-editor__selection-context strong { font-size: 15px; }
.tacom-editor__selection-context small { color: var(--tacom-muted); font-size: 10px; line-height: 1.35; margin-top: 3px; }
.tacom-editor__toolbar-row { align-items: end; display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.tacom-editor__toolbar-row--type { grid-column: 2; }
.tacom-editor__toolbar-row--spacing { grid-column: 2 / -1; }
.tacom-editor__field, .tacom-editor__advanced label { color: #444; display: grid; font-size: 11px; font-weight: 700; gap: 3px; margin: 0; min-width: 0; }
.tacom-editor__field--font { flex: 1 1 150px; }
.tacom-editor__field--size { flex: 0 0 88px; }
.tacom-editor__field--color { flex: 1 1 135px; }
.tacom-editor__field--spacing { flex: 1 1 240px; }
.tacom-editor__toolbar select, .tacom-editor__toolbar input[type="number"] { background: #fff; border: 1px solid #aaa; border-radius: 5px; height: 38px; min-width: 0; padding: 5px 8px; }
.tacom-editor__toolbar select { width: 100%; }
.tacom-editor__toolbar input[type="number"] { width: 66px; }
.tacom-editor__toolbar input[type="range"] { min-width: 90px; width: 100%; }
.tacom-editor__toolbar small { color: var(--tacom-muted); font-size: 10px; }
.tacom-editor__paired { align-items: center; display: flex; gap: 7px; min-width: 0; }
.tacom-editor__paired > input[type="range"] { flex: 1 1 auto; }
.tacom-editor__unit-input { align-items: center; display: flex; position: relative; }
.tacom-editor__unit-input input { padding-right: 24px !important; }
.tacom-editor__unit-input small { pointer-events: none; position: absolute; right: 7px; }
.tacom-editor__button-group { align-items: end; display: flex; gap: 3px; }
.tacom-editor__button-group button { align-items: center; background: #fff; border: 1px solid #aaa; border-radius: 5px; cursor: pointer; display: flex; font-size: 15px; height: 38px; justify-content: center; min-width: 40px; padding: 0 9px; }
.tacom-editor__button-group button[aria-pressed="true"], .tacom-editor__button-group button.is-active { background: #222; border-color: #222; color: #fff; }
.tacom-editor__align-group button span { display: block; line-height: .72; transform: scaleX(1.2); }
.tacom-editor__align-group [data-tacom-align="left"] span { transform: translateX(-3px) scaleX(1.2); }
.tacom-editor__align-group [data-tacom-align="right"] span { transform: translateX(3px) scaleX(1.2); }
.tacom-editor__advanced { border-top: 1px solid #ddd; grid-column: 1 / -1; padding-top: 8px; }
.tacom-editor__advanced summary { color: #555; cursor: pointer; font-size: 11px; font-weight: 700; width: fit-content; }
.tacom-editor__advanced-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.tacom-editor__advanced label small { font-weight: 400; line-height: 1.35; }

.tacom-editor__workspace { display: grid; gap: 22px; grid-template-columns: minmax(320px, .8fr) minmax(440px, 1.2fr); }
.tacom-editor__controls { border: 1px solid var(--tacom-line); border-radius: 8px; min-width: 0; padding: 14px; }
.tacom-logo-controls { background: #f8f8f8; border: 1px solid var(--tacom-line); border-radius: 7px; display: grid; gap: 10px; margin-bottom: 14px; padding: 12px; }
.tacom-logo-controls[hidden] { display: none; }
.tacom-logo-controls__heading { align-items: baseline; display: flex; gap: 10px; justify-content: space-between; }
.tacom-logo-controls__heading span, .tacom-logo-controls p { color: var(--tacom-muted); font-size: 11px; margin: 0; }
.tacom-logo-controls__upload { align-items: center; background: #fff; border: 1px dashed #aaa; border-radius: 6px; cursor: pointer; display: grid; gap: 6px; padding: 10px; }
.tacom-logo-controls__upload input { max-width: 100%; }
.tacom-logo-controls__grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tacom-logo-controls__grid label { display: grid; font-size: 11px; font-weight: 700; gap: 4px; }
.tacom-logo-controls__grid select, .tacom-logo-controls__grid input { max-width: 100%; width: 100%; }
.tacom-logo-controls .is-loading { color: #6b5b00; }
.tacom-logo-controls .is-success { color: #08783e; font-weight: 700; }
.tacom-logo-controls .is-error { color: var(--tacom-red-dark); font-weight: 700; }
.tacom-editor__controls-heading, .tacom-editor__preview-meta { align-items: center; display: flex; justify-content: space-between; margin-bottom: 12px; }
.tacom-editor__controls-heading > div { display: grid; gap: 2px; }
.tacom-editor__controls-heading > div span { color: var(--tacom-muted); font-size: 10px; }
.tacom-editor__lines { display: grid; gap: 8px; }
.tacom-line { align-items: center; border: 1px solid transparent; border-radius: 6px; display: grid; gap: 7px; grid-template-columns: 32px minmax(0, 1fr) auto; padding: 5px; }
.tacom-line.is-selected { background: var(--tacom-red-soft); border-color: #e6a39c; }
.tacom-line.is-problem { border-color: #c68600; box-shadow: inset 3px 0 0 #c68600; }
.tacom-line__number { background: #ededed; border: 0; border-radius: 50%; cursor: pointer; font-size: 11px; font-weight: 800; height: 28px; width: 28px; }
.tacom-line input { border: 1px solid #bbb; border-radius: 4px; height: 36px; min-width: 0; padding: 6px 8px; width: 100%; }
.tacom-line__actions { display: flex; gap: 3px; }
.tacom-line__actions button { background: #fff; border: 1px solid #bbb; border-radius: 4px; cursor: pointer; height: 30px; min-width: 30px; padding: 0 5px; }
.tacom-line__actions button:disabled { cursor: not-allowed; opacity: .35; }

.tacom-editor__preview-column { min-width: 0; }
.tacom-editor__preview-meta span { background: #ededed; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 5px 9px; }
.tacom-editor__preview { align-items: center; background: #ececec; border-radius: 8px; box-shadow: inset 0 0 0 1px #d2d2d2; display: flex; justify-content: center; max-height: 370px; min-height: 180px; overflow: hidden; padding: 24px; width: 100%; }
.tacom-editor__preview svg { background: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.16); display: block; height: auto; max-height: 320px; width: 100%; }
.tacom-editor__preview-help { color: var(--tacom-muted); font-size: 11px; margin: 8px 0 0; text-align: center; }
.tacom-editor__overflow { align-items: flex-start; background: #fff5db; border: 1px solid #e5bd57; border-left: 4px solid #c68600; border-radius: 6px; display: grid; gap: 3px; margin-top: 10px; padding: 10px 12px; }
.tacom-editor__overflow[hidden] { display: none; }
.tacom-editor__overflow span { color: #5d4b1a; font-size: 11px; }
.tacom-editor__overflow .button { justify-self: start; margin-top: 4px; }
.tacom-editor__preview.is-overflow { box-shadow: inset 0 0 0 2px #c68600; }
.tacom-editor__footer { align-items: center; border-top: 1px solid var(--tacom-line); display: flex; gap: 12px; justify-content: space-between; padding-top: 16px; }
.tacom-editor__footer > div { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .tacom-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tacom-editor__toolbar { grid-template-columns: minmax(135px, .45fr) minmax(0, 1.55fr); }
  .tacom-editor__toolbar-row--type, .tacom-editor__toolbar-row--spacing { grid-column: 2; }
  .tacom-editor__selection-context { grid-row: span 3; }
  .tacom-editor__advanced { grid-column: 1 / -1; }
  .tacom-editor__workspace { grid-template-columns: 1fr; }
  .tacom-editor__preview { min-height: 220px; }
}

@media (max-width: 600px) {
  .tacom-ordering-notice { gap: 11px; margin-bottom: 24px; padding: 15px 14px; }
  .tacom-ordering-notice__contacts { display: grid; gap: 5px; }
  .tacom-stamp { margin: 18px 0; padding: 16px; }
  .tacom-stamp__heading { display: grid; }
  .tacom-stamp__size { justify-self: start; }
  .tacom-stamp__method { align-items: flex-start; padding: 12px; }
  .tacom-stamp__method-marker { display: none; }
  .tacom-stamp__selection { align-items: stretch; display: grid; }
  .tacom-stamp__selection .button { width: 100%; }
  .tacom-stamp-modal__dialog { border-radius: 0; inset: 0; max-height: 100vh; }
  .tacom-stamp-modal__header { padding: 14px 15px; }
  .tacom-stamp-modal__header h2 { font-size: 19px; }
  .tacom-stamp-modal__body { padding: 15px; }
	[data-tacom-editor-step], .tacom-editor, .tacom-editor__toolbar, .tacom-editor__workspace, .tacom-editor__controls, .tacom-editor__preview-column, .tacom-editor__preview { max-width: 100%; min-width: 0; width: 100%; }
  .tacom-template-grid { grid-template-columns: 1fr; }
	.tacom-template-filters { flex-wrap: nowrap; margin-left: -15px; margin-right: -15px; overflow-x: auto; padding: 0 15px 5px; }
	.tacom-template-filter { flex: 0 0 auto; min-height: 44px; }
  .tacom-editor__toolbar { grid-template-columns: 1fr; padding: 10px; }
  .tacom-editor__selection-context, .tacom-editor__toolbar-row--type, .tacom-editor__toolbar-row--spacing, .tacom-editor__advanced { grid-column: 1; grid-row: auto; }
  .tacom-editor__selection-context small { display: none; }
  .tacom-editor__toolbar-row { align-items: stretch; }
  .tacom-editor__field--font { flex-basis: 145px; }
  .tacom-editor__field--spacing { flex-basis: 100%; }
  .tacom-editor__button-group button { min-height: 44px; min-width: 44px; }
  .tacom-editor__toolbar select, .tacom-editor__toolbar input[type="number"] { min-height: 44px; }
  .tacom-editor__advanced-grid { grid-template-columns: 1fr; }
	.tacom-editor__paired { width: 100%; }
	.tacom-editor__workspace { display: flex; flex-direction: column-reverse; }
  .tacom-editor__preview { min-height: 145px; padding: 12px; }
  .tacom-line { grid-template-columns: 28px minmax(0, 1fr); }
  .tacom-line__actions { grid-column: 2; justify-content: flex-end; }
	.tacom-logo-controls__grid { grid-template-columns: 1fr; }
	.tacom-logo-controls__upload input[type="file"] { min-width: 0; width: 100%; }
  .tacom-editor__footer { align-items: stretch; display: grid; }
  .tacom-editor__footer > div { display: grid; }
  .tacom-editor__footer .button { min-height: 44px; width: 100%; }
}
