.gft-root {
  --gft-bg: linear-gradient(180deg, #f6f9ff 0%, #edf3fb 100%);
  --gft-panel: #ffffff;
  --gft-primary: #195f9d;
  --gft-accent: #f29f05;
  --gft-line: #6389b0;
  --gft-text: #1f2d3d;
  --gft-muted: #5b6f85;
  background: var(--gft-bg);
  border: 1px solid #d6e1ef;
  border-radius: 18px;
  padding: 18px;
  color: var(--gft-text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.gft-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.gft-search,
.gft-clear {
  height: 42px;
  border: 1px solid #b8cde3;
  border-radius: 10px;
}

.gft-search {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  background: #fff;
}

.gft-clear {
  min-width: 96px;
  padding: 0 16px;
  cursor: pointer;
  background: #fff;
  font-weight: 600;
}

.gft-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.gft-canvas-wrap {
  position: relative;
  min-height: 760px;
  background: repeating-linear-gradient(
      90deg,
      rgba(139, 163, 190, 0.06),
      rgba(139, 163, 190, 0.06) 1px,
      transparent 1px,
      transparent 110px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 255, 0.95));
  border: 1px solid #d1dfef;
  border-radius: 14px;
  overflow: auto;
  width: 100%;
}

.gft-svg,
.gft-canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.gft-edge {
  stroke: var(--gft-line);
  stroke-width: 1.5;
  fill: none;
}

.gft-edge-partner {
  stroke: #436d99;
  stroke-width: 2;
}

.gft-edge-child,
.gft-edge-connector {
  stroke: #7fa0c0;
}

.gft-card {
  position: absolute;
  width: 128px;
  height: 146px;
  border: 1px solid #c4d7eb;
  border-radius: 14px;
  background: var(--gft-panel);
  box-shadow: 0 6px 14px rgba(40, 67, 92, 0.12);
  padding: 0;
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gft-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(40, 67, 92, 0.16);
}

.gft-card.is-selected {
  border-color: var(--gft-accent);
  box-shadow: 0 0 0 3px rgba(242, 159, 5, 0.25), 0 10px 20px rgba(40, 67, 92, 0.2);
}

.gft-photo-wrap {
  display: block;
  width: 100%;
  height: 74px;
  background: linear-gradient(180deg, #f0ede3 0%, #ddd7c5 100%);
  padding: 6px;
}

.gft-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
  background: #ebe7dd;
  border-radius: 8px 8px 0 0;
}

.gft-name,
.gft-years {
  display: block;
}

.gft-name {
  background: var(--gft-primary);
  color: #fff;
  padding: 8px 10px 7px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  min-height: 46px;
}

.gft-years {
  padding: 8px 10px 10px;
  font-size: 12px;
  line-height: 1.25;
  color: #2f4d69;
  font-weight: 600;
}

.gft-panel {
  position: sticky;
  top: 18px;
  border: 1px solid #d1dfef;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(26, 53, 80, 0.08);
}

.gft-panel h3 {
  margin: 0 0 12px;
  font-size: 24px;
}

.gft-panel-body {
  color: var(--gft-text);
  font-size: 14px;
  line-height: 1.5;
}

.gft-detail-card {
  margin-bottom: 16px;
}

.gft-detail-photo-wrap {
  width: 100%;
  height: 240px;
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f3f0e8 0%, #e2dbc8 100%);
  margin-bottom: 12px;
}

.gft-detail-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  background: #ebe7dd;
  border-radius: 10px;
}

.gft-detail-name {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 4px;
}

.gft-detail-life {
  font-size: 16px;
  font-weight: 600;
  color: #36556f;
  margin-bottom: 10px;
}

.gft-detail-meta,
.gft-related {
  font-size: 14px;
  margin-top: 6px;
}

.gft-detail-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e1e8f0;
}

.gft-detail-section h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.gft-list {
  margin: 0;
  padding-left: 18px;
}

.gft-list li {
  margin-bottom: 10px;
}

.gft-muted {
  color: var(--gft-muted);
}

.gft-loading,
.gft-empty,
.gft-error {
  padding: 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d6e1ef;
}

.gft-error {
  border-color: #e2a0a0;
  color: #8a1f1f;
}

.gft-preview-shell {
  display: grid;
  gap: 16px;
  width: calc(100vw - 32px);
  max-width: calc(100vw - 32px);
  margin-left: 50%;
  transform: translateX(-50%);
}

.gft-preview-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: #123c63;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gft-login-gate {
  padding: 28px;
  border: 1px solid #d6dfeb;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffdfa 0%, #eef6ff 100%);
}

.gft-login-button {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: #195f9d;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .gft-layout {
    grid-template-columns: 1fr;
  }

  .gft-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .gft-preview-shell {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
  }

  .gft-root {
    padding: 14px;
  }

  .gft-canvas-wrap {
    min-height: 560px;
  }

  .gft-toolbar {
    flex-wrap: wrap;
  }

  .gft-clear {
    width: 100%;
  }
}

.gft-card-action {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 1px solid #c8d8ea;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  color: #1d4f7e;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  cursor: pointer;
}

.gft-card-action-tl { top: 4px; left: 4px; }
.gft-card-action-tr { top: 4px; right: 4px; }
.gft-card-action-bl { bottom: 32px; left: 4px; }
.gft-card-action-br { bottom: 32px; right: 4px; }

.gft-panel-actions,
.gft-chip-row,
.gft-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gft-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.gft-form-grid {
  display: grid;
  gap: 12px;
}

.gft-form-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gft-form-grid label {
  display: grid;
  gap: 6px;
}

.gft-form-grid span {
  font-weight: 600;
}

.gft-form-full {
  grid-column: 1 / -1;
}

.gft-rel-card {
  width: 100%;
  padding: 12px;
  border: 1px solid #d9e4ef;
  border-radius: 12px;
  background: #f9fbff;
}

.gft-rel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.gft-rel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.gft-link-button,
.gft-chip-button {
  border: 1px solid #cbd9e8;
  border-radius: 999px;
  background: #fff;
  color: #1d4f7e;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
}

.gft-rel-children {
  margin-top: 10px;
}

.gft-save-status {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #47627d;
}

.gft-save-status.is-error {
  color: #9b1f1f;
}

.gft-save-status.is-success {
  color: #1a6d37;
}

@media (max-width: 760px) {
  .gft-form-grid-two,
  .gft-detail-header {
    grid-template-columns: 1fr;
    display: grid;
  }
}

