:root {
  --primary: #c2410c;
  --primary-hover: #9a3412;
  --primary-light: #fff7ed;
  --surface: #ffffff;
  --bg: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Header */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Hero Section */
.hero-sec {
  max-width: 1120px;
  margin: 2.2rem auto 1.5rem auto;
  padding: 0 1.25rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

/* App Box */
.app-box {
  max-width: 1120px;
  margin: 1.5rem auto 3rem auto;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 1.25rem;
}

/* Multi-Tool Suite Tabs */
.suite-tabs-wrap {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0.25rem;
}
.suite-tabs-nav {
  display: inline-flex;
  align-items: center;
  background: transparent;
  padding: 0;
  margin-bottom: -1px;
  gap: 2.2rem;
  border: none;
  box-shadow: none;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.suite-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 0.6rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  user-select: none;
}
.suite-tab-item svg {
  opacity: 0.65;
  transition: opacity 0.15s ease;
  color: currentColor;
}
.suite-tab-item:hover {
  color: #0f172a;
  background: transparent;
  border-color: rgba(0, 0, 0, 0.18);
}
.suite-tab-item:hover svg {
  opacity: 0.9;
}
.suite-tab-item.active {
  background: transparent;
  color: #0f172a;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid #0f172a;
  box-shadow: none;
  border-radius: 0;
}
.suite-tab-item.active svg {
  color: #0f172a;
  opacity: 1;
}

@media (max-width: 768px) {
  .suite-tabs-wrap {
    width: 100%;
    margin-bottom: 1.25rem;
    border-bottom: none;
    padding: 0;
    justify-content: stretch;
  }
  .suite-tabs-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .suite-tab-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
  }
  .suite-tab-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .suite-tab-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    color: currentColor;
  }
  .suite-tab-item:hover,
  .suite-tab-item:focus {
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.2);
    text-decoration: none;
  }
  .suite-tab-item.active {
    color: #0f172a;
    font-weight: 700;
    background: #f8fafc;
    border: 1.5px solid #0f172a;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  }
  .suite-tab-item.active svg {
    color: #0f172a;
    opacity: 1;
  }
}

/* Minimalist Dropzone */
.dropzone {
  border: 1.5px dashed #cbd5e1;
  border-radius: 18px;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}
.dropzone:hover {
  border-color: #0f172a;
  background: #fafafa;
}
.dropzone-icon-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.1rem;
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.dropzone:hover .dropzone-icon-badge {
  transform: translateY(-2px);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.12);
}
.dropzone-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.2rem;
  letter-spacing: -0.01em;
}
.dropzone-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.7rem 1.6rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 1rem;
}
.dropzone-cta-btn:hover {
  border-color: #0f172a;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.dropzone-hints {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.dropzone-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: #64748b;
  background: transparent;
  padding: 0;
  border: none;
  font-weight: 500;
}
@media (max-width: 768px) {
  .dropzone {
    padding: 2.4rem 1.2rem;
    border-radius: 16px;
  }
  .dropzone-icon-badge {
    width: 46px;
    height: 46px;
    margin-bottom: 0.8rem;
  }
  .dropzone-title {
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
  }
  .dropzone-cta-btn {
    padding: 0.6rem 1.35rem;
    font-size: 0.88rem;
  }
}

/* Demo Samples Buttons */
.btn-demo-sample {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-demo-sample:hover {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #ea580c;
  transform: translateY(-1px);
}

/* Studio Top Ribbon */
.studio-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}
.ribbon-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ribbon-icon {
  font-size: 1.1rem;
}
.ribbon-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}
.ribbon-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.ribbon-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ribbon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.ribbon-btn.primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* Studio Body: Vertical Top-and-Bottom Layout (Canvas Top, Controls Below) */
.studio-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* Top: Viewport Card - Clean Studio Canvas */
.viewport-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  max-height: 620px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}
.viewport-stage {
  position: relative;
  display: inline-block;
  user-select: none;
  touch-action: none;
}
#cropCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  background: repeating-conic-gradient(#f8fafc 0% 25%, #f1f5f9 0% 50%) 50% / 16px 16px;
}

/* Crop Box Overlay */
.crop-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 150px;
  box-sizing: border-box;
  border: 2px dashed #0f172a;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45), 0 0 10px rgba(0,0,0,0.15);
  cursor: move;
  touch-action: none;
}
.crop-box.shape-circle {
  border-radius: 50% !important;
}
.crop-box.shape-rounded {
  border-radius: 20px;
}

/* Grid Lines */
.crop-grid-line {
  position: absolute;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.5);
}
.crop-grid-line.h1 { top: 33.333%; left: 0; right: 0; height: 1px; }
.crop-grid-line.h2 { top: 66.666%; left: 0; right: 0; height: 1px; }
.crop-grid-line.v1 { left: 33.333%; top: 0; bottom: 0; width: 1px; }
.crop-grid-line.v2 { left: 66.666%; top: 0; bottom: 0; width: 1px; }

/* 8 Resize Handles */
.crop-handle {
  position: absolute;
  width: 11px;
  height: 11px;
  background: #0f172a;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  z-index: 10;
}
.handle-tl { top: -6px; left: -6px; cursor: nwse-resize; }
.handle-t  { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.handle-tr { top: -6px; right: -6px; cursor: nesw-resize; }
.handle-r  { top: 50%; right: -6px; transform: translateY(-50%); cursor: ew-resize; }
.handle-br { bottom: -6px; right: -6px; cursor: nwse-resize; }
.handle-b  { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.handle-bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.handle-l  { top: 50%; left: -6px; transform: translateY(-50%); cursor: ew-resize; }

/* Crop Size Floating Badge */
.crop-size-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  pointer-events: none;
}

/* Bottom: Inspector & Operations Deck (Below Canvas in 3-column Responsive Grid) */
.inspector-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 992px) {
  .inspector-card {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .inspector-card {
    grid-template-columns: 1fr;
  }
}

.inspector-section {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}
.inspector-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

/* Presets Grid */
.presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.preset-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.preset-pill.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: none;
}

/* Specifications Grid */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.spec-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}
.spec-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.spec-btn.active {
  border-color: #0f172a;
  background: #f8fafc;
}
.spec-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
}
.spec-meta {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 2px;
}

/* Shape Switcher */
.shape-switch-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.shape-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.shape-btn:hover {
  background: #e2e8f0;
}
.shape-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* Transform Row */
.transform-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.tool-icon-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tool-icon-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Dimensions Row */
.dim-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.dim-input-group {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 8px;
}
.dim-input-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  margin-right: 6px;
}
.dim-input-group input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  outline: none;
}
.dim-input-group span {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Export Section */
.export-section {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.format-select-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.fmt-radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}
.fmt-radio input {
  accent-color: #0f172a;
}
.btn-crop-download {
  width: 100%;
  background: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  transition: all 0.15s ease;
  margin-top: 0.5rem;
}
.btn-crop-download:hover {
  background: #1e293b;
  transform: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}
