/* Isolated, shadow-free holiday UI. Graphik and base tokens come from the host. */
.gratitude-tree {
  --gt-cream: var(--holiday-cream, #fbf1d9);
  --gt-sky: var(--holiday-sky, #91c8e8);
  --gt-pink: var(--holiday-pink, #f0c2cf);
  --gt-gold: var(--holiday-gold, #f2d17a);
  --gt-ink: var(--text, #000000);
  --gt-blue: var(--primary, #3D3BFF);
  color: var(--gt-ink);
  font-family: var(--font-family, "Graphik");
  font-size: 14px;
  line-height: 1.5;
  min-width: 0;
  width: 100%;
}
.gratitude-tree *, .gratitude-tree *::before, .gratitude-tree *::after { box-sizing: border-box; }
.gratitude-tree [hidden] { display: none !important; }
.gratitude-tree .gt-demo-note { margin: var(--space-md) 0 0; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); background: var(--gt-cream); font-size: 12px; }
.gratitude-tree button, .gratitude-tree input, .gratitude-tree textarea { font: inherit; color: var(--gt-ink); }
.gratitude-tree button { -webkit-tap-highlight-color: transparent; }
.gratitude-tree button:focus-visible, .gratitude-tree input:focus-visible, .gratitude-tree textarea:focus-visible { outline: 3px solid var(--gt-blue); outline-offset: 3px; }
.gratitude-tree button:disabled { cursor: default; opacity: .5; }
.gratitude-tree h2, .gratitude-tree h3, .gratitude-tree h4 { color: var(--gt-ink); font-weight: 600; letter-spacing: -.03em; }
.gt-header { margin-bottom: var(--space-lg, 24px); padding-right: var(--space-lg, 24px); }
.gt-header-kicker { margin: 0 0 var(--space-sm, 12px); font-size: 12px; }
.gratitude-tree .gt-title { margin: 0 0 var(--space-md, 16px); font-size: clamp(30px, 3.2vw, 42px); line-height: 1.12; letter-spacing: -.045em; text-wrap: balance; }
.gt-intro { margin: 0; max-width: 830px; font-size: var(--body-size, 16px); line-height: 1.5; white-space: pre-line; }
.gt-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: var(--space-xl, 32px); align-items: start; }
.gt-tree-panel { position: relative; min-width: 0; }
/* A winter sky and layered snow are painted inside the existing 600 × 660
   coordinate frame: neither the artwork nor the hit targets are rescaled. */
.gt-stage {
  width: 100%; aspect-ratio: 600 / 660; position: relative; isolation: isolate;
  border-radius: var(--radius-lg, 26px);
  background:
    radial-gradient(circle at 14% 15%, #fff 0 2px, transparent 2.5px),
    radial-gradient(circle at 82% 13%, #fff 0 2px, transparent 2.5px),
    radial-gradient(circle at 9% 36%, #e9f8ff 0 3px, transparent 3.5px),
    radial-gradient(circle at 90% 31%, #e9f8ff 0 3px, transparent 3.5px),
    radial-gradient(circle at 18% 56%, #fff 0 2px, transparent 2.5px),
    radial-gradient(circle at 86% 53%, #fff 0 2px, transparent 2.5px),
    radial-gradient(circle at 22% 27%, #e9f8ff 0 1.5px, transparent 2px),
    radial-gradient(circle at 73% 25%, #e9f8ff 0 1.5px, transparent 2px),
    radial-gradient(circle at 6% 65%, #e9f8ff 0 1.5px, transparent 2px),
    radial-gradient(circle at 95% 65%, #e9f8ff 0 1.5px, transparent 2px),
    linear-gradient(165deg, #547bb2 0%, #82b5d5 53%, #d2e9ee 100%);
}
.gt-stage::after {
  content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 62% 13% at 5% 101%, #fff 99%, transparent 100%),
    radial-gradient(ellipse 70% 12% at 103% 101%, #f8fdff 99%, transparent 100%),
    radial-gradient(ellipse 64% 12% at 77% 100%, #dceef5 99%, transparent 100%),
    radial-gradient(ellipse 64% 10% at 15% 98%, #e5f3f7 99%, transparent 100%);
}
.gt-pine { display: block; position: relative; z-index: 0; width: 100%; height: 100%; overflow: visible; }
.gt-slots { position: absolute; z-index: 2; inset: 0; }
.gt-stage-label { position: absolute; z-index: 3; left: var(--space-md, 16px); right: var(--space-md, 16px); bottom: 1.6%; font-size: 12px; text-align: center; pointer-events: none; }
.gt-page-nav { display: flex; align-items: center; justify-content: center; gap: var(--space-md, 16px); margin-top: var(--space-sm, 12px); }
.gt-page-label { font-size: 12px; min-width: 100px; text-align: center; }
.gratitude-tree .gt-page-nav button { padding: 0; width: 40px; height: 36px; min-height: 36px; font-size: 21px; }
.gt-tree-error { margin: var(--space-sm, 12px) 0; }
.gt-tree-retry { margin-top: var(--space-xs, 8px); }
.gt-ball, .gt-slot { position: absolute; margin: 0; padding: 0; border: 0; transform: translate(-50%, -50%); display: grid; place-items: center; cursor: pointer; background: transparent; border-radius: var(--radius-pill, 999px); }
.gt-ball { width: 10.5%; height: auto; aspect-ratio: 60 / 62; z-index: 2; transform-origin: 50% 8%; }
.gt-ball svg { display: block; width: 100%; height: auto; transition: transform 180ms ease; }
.gt-ball:hover, .gt-ball:focus-visible { z-index: 8; }
.gt-ball:hover svg, .gt-ball:focus-visible svg { transform: rotate(-7deg) scale(1.1); }
.gt-ball-tooltip { display: none; position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(210px, 48vw); background: var(--bg, #fff); color: var(--gt-ink); border-radius: var(--radius-sm, 12px); padding: var(--space-xs, 8px) var(--space-sm, 12px); font-size: 12px; overflow-wrap: anywhere; pointer-events: none; }
.gt-ball:hover .gt-ball-tooltip, .gt-ball:focus-visible .gt-ball-tooltip { display: block; }
.gt-slot { width: 36px; height: 36px; z-index: 3; color: #000; }
.gt-slot::before { content: ""; position: absolute; width: 20px; height: 20px; border-radius: var(--radius-pill, 999px); background: var(--gt-cream); border: 1px dashed #000; transition: transform 160ms ease, background 160ms ease; }
.gt-slot span { z-index: 1; font-size: 17px; line-height: 1; }
.gt-slot:hover::before, .gt-slot:focus-visible::before, .gt-slot-target::before { transform: scale(1.3); background: var(--gt-gold); border-style: solid; }
.gratitude-tree:not(.gt-is-placement) .gt-slot { display: none; }
.gt-is-busy .gt-slot { pointer-events: none; }
.gt-is-placement .gt-stage { outline: 2px dashed var(--gt-blue); outline-offset: 3px; }
.gt-message-card { position: absolute; z-index: 10; left: var(--space-md, 16px); right: var(--space-md, 16px); bottom: var(--space-2xl, 48px); background: var(--bg, #fff); padding: var(--space-lg, 24px); border-radius: var(--radius-md, 18px); max-height: 80%; overflow-y: auto; }
.gt-card-kicker { display: block; padding-right: var(--space-xl, 32px); font-size: 12px; }
.gratitude-tree .gt-card-recipient { margin: var(--space-xs, 8px) 0 var(--space-md, 16px); font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.gt-card-message { margin: 0 0 var(--space-md, 16px); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.gt-card-author { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.gratitude-tree .gt-card-close { position: absolute; top: var(--space-sm, 12px); right: var(--space-sm, 12px); width: 32px; min-height: 32px; padding: 0; font-size: 22px; }
.gt-composer { padding: var(--space-sm, 12px) 0 0; min-width: 0; }
.gratitude-tree .gt-compose-title { margin: 0 0 var(--space-lg, 24px); font-size: clamp(23px, 2.3vw, 28px); line-height: 1.2; max-width: 330px; }
.gt-ornaments { border: 0; padding: 0; margin: 0 0 var(--space-lg, 24px); min-width: 0; }
.gt-ornaments legend { padding: 0; margin: 0 0 var(--space-sm, 12px); font-weight: 500; font-size: 13px; }
.gt-ornament-options { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: var(--space-xs, 8px); }
.gt-ornament-choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; min-width: 0; padding: var(--space-xs, 8px) 0; background: var(--surface, #f5f5f5); border-radius: var(--radius-sm, 12px); }
.gt-ornament-choice:has(input:checked) { outline: 2px solid var(--gt-blue); outline-offset: 1px; }
.gt-ornament-choice:has(input:focus-visible) { outline: 3px solid var(--gt-ink); outline-offset: 3px; }
.gt-ornament-choice input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; }
.gt-choice-art { display: block; width: 100%; max-width: 56px; }
.gt-choice-art svg { width: 100%; height: auto; display: block; transition: transform 180ms ease; }
.gt-ornament-choice:hover .gt-choice-art svg { transform: rotate(-6deg); }
.gt-choice-marker { display: block; width: 11px; height: 11px; border: 1px solid var(--gt-ink); border-radius: var(--radius-pill, 999px); margin-top: var(--space-xs, 8px); }
.gt-ornament-choice input:checked ~ .gt-choice-marker { background: var(--gt-blue); border-color: var(--gt-blue); }
.gt-ornament-choice:has(input:disabled) { cursor: default; }
.gt-field { display: grid; grid-template-columns: 1fr auto; gap: var(--space-xs, 8px); margin-bottom: var(--space-md, 16px); }
.gt-field label { font-size: 13px; font-weight: 500; }
.gratitude-tree .gt-field input, .gratitude-tree .gt-field textarea, .gratitude-tree .gt-search { grid-column: 1 / -1; width: 100%; padding: var(--space-sm, 12px) var(--space-md, 16px); background: var(--bg, #fff); border: 1px solid var(--field-border, #d9d9d9); border-radius: var(--radius-sm, 12px); line-height: 1.5; min-width: 0; }
.gratitude-tree .gt-field input:focus, .gratitude-tree .gt-field textarea:focus, .gratitude-tree .gt-search:focus { border-color: var(--gt-ink); }
.gratitude-tree .gt-field textarea { resize: vertical; min-height: 120px; max-height: 290px; }
.gratitude-tree input::placeholder, .gratitude-tree textarea::placeholder { color: var(--placeholder, #8d8d8d); opacity: 1; }
.gt-counter { grid-column: 2; font-size: 10px; line-height: 1; }
.gt-author { font-size: 12px; margin: 0 0 var(--space-xs, 8px); overflow-wrap: anywhere; }
.gt-privacy-note { font-size: 12px; line-height: 1.5; margin: 0 0 var(--space-md, 16px); }
.gratitude-tree .gt-button { display: inline-flex; justify-content: center; align-items: center; gap: var(--space-xs, 8px); border: 0; padding: var(--space-sm, 12px) var(--space-md, 16px); border-radius: var(--radius-sm, 12px); min-height: 46px; font-size: 13px; line-height: 1.35; font-weight: 500; text-align: center; cursor: pointer; transition: background 180ms ease, transform 180ms ease; text-decoration: none; }
.gratitude-tree .gt-button:hover:not(:disabled) { transform: translateY(-1px); }
.gratitude-tree .gt-primary { background: var(--gt-blue); color: #fff; }
.gratitude-tree .gt-primary:hover:not(:disabled) { background: var(--primary-hover, #302ee6); }
.gratitude-tree .gt-subtle { background: var(--surface, #f5f5f5); color: var(--gt-ink); }
.gratitude-tree .gt-subtle:hover:not(:disabled) { background: var(--gt-cream); }
.gt-prepare, .gt-auto, .gt-new, .gt-post-retry, .gt-private { width: 100%; }
.gt-private { margin-top: var(--space-sm, 12px); }
.gt-private-saved { margin-top: var(--space-md, 16px); padding: var(--space-md, 16px); background: var(--holiday-cream, #fff4df); border-radius: var(--radius-sm, 12px); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.gt-private-saved summary { cursor: pointer; font-weight: 500; }
.gt-private-saved p, .gt-private-read-error { white-space: pre-wrap; overflow-wrap: anywhere; }
.gt-reward-note { margin: var(--space-md, 16px) 0 0; font-size: 12px; line-height: 1.55; max-width: 330px; }
.gt-reward-deadline { margin: 0 0 var(--space-md, 16px); padding: var(--space-sm, 12px) var(--space-md, 16px); background: var(--surface, #f5f5f5); border-radius: var(--radius-sm, 12px); font-size: 12px; line-height: 1.5; }
.gt-placement { text-align: left; padding-top: var(--space-md, 16px); }
.gt-step-label { display: inline-flex; background: var(--gt-cream); font-size: 12px; border-radius: var(--radius-pill, 999px); padding: var(--space-xs, 8px) var(--space-sm, 12px); }
.gratitude-tree .gt-placement h3, .gratitude-tree .gt-complete h3, .gratitude-tree .gt-closed h3 { font-size: 28px; line-height: 1.2; margin: var(--space-md, 16px) 0; }
.gt-placement p, .gt-complete p, .gt-closed p { margin: 0 0 var(--space-md, 16px); }
.gt-drag-ball { display: block; width: 112px; height: 120px; margin: var(--space-lg, 24px) auto var(--space-md, 16px); padding: var(--space-xs, 8px); background: var(--gt-cream); border: 0; border-radius: var(--radius-lg, 26px); cursor: grab; touch-action: none; user-select: none; }
.gt-drag-ball svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.gt-dragging .gt-drag-ball { cursor: grabbing; }
.gt-placement-to { text-align: center; font-size: 13px; overflow-wrap: anywhere; }
.gt-edit { margin-top: var(--space-sm, 12px); width: 100%; }
.gratitude-tree.gt-drag-ghost { position: fixed; z-index: 10000; pointer-events: none; width: 76px; height: 80px; transform: translate(-50%, -50%) rotate(-8deg); margin: 0; }
.gt-drag-ghost svg { width: 100%; height: 100%; }
.gt-complete { padding: var(--space-lg, 24px) 0; }
.gt-complete-ball { width: 100px; height: 106px; margin: 0 auto var(--space-lg, 24px); }
.gt-complete-ball svg { display: block; width: 100%; height: 100%; }
.gt-closed { padding: var(--space-lg, 24px); background: var(--gt-cream); border-radius: var(--radius-md, 18px); }
.gt-is-complete .gt-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gt-status:empty { display: none; }
.gt-status { font-size: 12px; margin: var(--space-md, 16px) 0 0; }
.gt-error { font-size: 13px; background: var(--gt-pink); padding: var(--space-sm, 12px) var(--space-md, 16px); border-radius: var(--radius-sm, 12px); margin: var(--space-md, 16px) 0; overflow-wrap: anywhere; }
.gt-messages-section { margin-top: var(--space-xl, 32px); }
.gt-list-heading { display: flex; flex-wrap: wrap; gap: var(--space-md, 16px); justify-content: space-between; align-items: center; margin-bottom: var(--space-md, 16px); }
.gratitude-tree .gt-list-heading h3 { margin: 0; font-size: 26px; line-height: 1.2; }
.gt-mine-label { display: inline-flex; gap: var(--space-xs, 8px); align-items: center; font-size: 12px; cursor: pointer; }
.gt-mine { accent-color: var(--gt-blue); width: 18px; height: 18px; margin: 0; }
.gt-search-field { display: grid; gap: var(--space-xs, 8px); margin-bottom: var(--space-lg, 24px); }
.gt-search-field label { font-size: 12px; font-weight: 500; }
.gratitude-tree .gt-search { max-width: 440px; }
.gt-message-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-md, 16px); }
.gt-list-card { display: flex; align-items: start; gap: var(--space-sm, 12px); background: var(--surface, #f5f5f5); border-radius: var(--radius-md, 18px); padding: var(--space-md, 16px); min-width: 0; }
.gt-list-ball { width: 44px; flex: 0 0 44px; }
.gt-list-ball svg { width: 100%; height: auto; display: block; }
.gt-list-copy { min-width: 0; }
.gratitude-tree .gt-list-copy h4 { margin: 0 0 var(--space-xs, 8px); font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.gt-list-message { font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 var(--space-sm, 12px); }
.gt-list-author { font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; margin: 0; }
.gt-list-status { font-size: 13px; margin: var(--space-md, 16px) 0; }
.gt-more { display: flex !important; margin: var(--space-md, 16px) auto 0; }
.gratitude-tree .gt-more[hidden] { display: none !important; }
@keyframes gt-published-sway { 0% { transform: translate(-50%, -50%) rotate(-13deg); } 40% { transform: translate(-50%, -50%) rotate(9deg); } 70% { transform: translate(-50%, -50%) rotate(-4deg); } 100% { transform: translate(-50%, -50%) rotate(0); } }
.gt-ball-new { animation: gt-published-sway 800ms ease-out 1; }
@media (max-width: 760px) {
  .gt-layout { grid-template-columns: 1fr; gap: var(--space-lg, 24px); }
  .gt-tree-panel { width: 100%; max-width: 560px; margin-inline: auto; }
  .gt-stage { max-height: none; }
  .gt-composer { padding: 0; }
  .gratitude-tree .gt-compose-title { max-width: none; }
  .gt-ornament-options { max-width: 400px; }
  .gt-reward-note { max-width: none; }
  .gt-placement { padding-top: 0; }
  .gt-is-placement .gt-layout { gap: var(--space-md, 16px); }
  .gt-is-placement .gt-stage { outline-width: 1px; }
  .gt-message-list { grid-template-columns: 1fr; }
  .gt-messages-section { margin-top: var(--space-xl, 32px); }
  .gt-header { padding-right: var(--space-md, 16px); }
  .gt-drag-ball { margin-top: var(--space-md, 16px); }
}
@media (max-width: 390px) {
  .gt-slot { width: 30px; height: 30px; }
  .gt-slot::before { width: 18px; height: 18px; }
  .gratitude-tree .gt-title { font-size: 28px; }
  .gt-list-card { padding: var(--space-sm, 12px); }
  .gt-message-card { left: var(--space-xs, 8px); right: var(--space-xs, 8px); padding: var(--space-md, 16px); }
}
@media (prefers-reduced-motion: reduce) {
  .gratitude-tree *, .gratitude-tree *::before, .gratitude-tree *::after { animation: none !important; transition: none !important; }
}
