/* ==========================================================================
   Favicon Works v0.1.0
   © 2026 Telisia Works. All rights reserved.
   ========================================================================== */

:root {
  --bg:       #ede4d3;
  --bg-soft:  #f5eee0;
  --bg-warm:  #e0d4be;
  --bg-card:  #faf6ec;
  --ink:      #2a2218;
  --ink2:     #5b4a35;
  --ink3:     #8b7861;
  --accent:   #c8541e;
  --accent-soft: rgba(200,84,30,0.10);
  --accent-hov: #a84418;
  --border:   #c9bba0;
  --border-soft: #d9ccaf;

  --cat-input:    #c8541e;
  --cat-edit:     #b89968;
  --cat-preview:  #6a7c9a;
  --cat-output:   #6b8e6f;
  --cat-code:     #82624a;

  --good: #6b8e6f;
  --bad:  #a14242;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(139,120,97,0.15) 1px, transparent 0);
  background-size: 18px 18px;
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}

/* === ヘッダー === */
.app-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-h1 {
  font-family: "Cormorant Garamond", "Yu Mincho", serif;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.app-h1 .works { color: var(--accent); }
.header-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.header-link {
  font-family: "Cormorant Garamond", "Yu Mincho", serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink2);
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.15s ease;
}
.header-link .em { color: var(--accent); }
.header-link:hover { color: var(--accent); }
.header-link:hover .em { color: var(--accent); }

/* === メインレイアウト === */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 1px;
  background: var(--border);
  min-height: calc(100vh - 60px);
}
.col {
  background: var(--bg-soft);
  padding: 18px;
  overflow-y: auto;
}
.col-header {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 8px;
  font-weight: 700;
}
.col-header .badge { display: inline-block; width: 6px; height: 6px; }
.col-header.input .badge { background: var(--cat-input); }
.col-header.edit .badge { background: var(--cat-edit); }
.col-header.preview .badge { background: var(--cat-preview); }
.col-header.output .badge { background: var(--cat-output); }
.col-header.code .badge { background: var(--cat-code); }

/* === LEFT === */
.sub-tabs {
  display: flex; gap: 4px;
  margin-bottom: 12px;
  font-size: 0.78rem;
}
.sub-tabs button {
  flex: 1; text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  padding: 7px 0;
  color: var(--ink3);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.sub-tabs button:hover { background: var(--bg-warm); }
.sub-tabs button.active {
  background: var(--ink);
  color: var(--bg-soft);
  border-color: var(--ink);
  font-weight: 600;
}

.dz {
  border: 2px dashed var(--cat-input);
  background: rgba(200,84,30,0.04);
  padding: 24px 14px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--cat-input);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 12px;
}
.dz:hover, .dz.drag {
  background: rgba(200,84,30,0.10);
  border-style: solid;
}
.dz .hint {
  display: block;
  font-size: 0.72rem;
  color: var(--ink3);
  margin-top: 6px;
}

.input-text-area, .input-emoji-area {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.input-text-area.active, .input-emoji-area.active { display: flex; }

.field-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.field-row label {
  font-size: 0.78rem;
  color: var(--ink2);
  flex-shrink: 0;
  min-width: 56px;
}
.field-row input[type="text"], .field-row input[type="color"], .field-row select, .field-row input[type="number"] {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.83rem;
  color: var(--ink);
}
.field-row input[type="color"] { padding: 2px; height: 30px; cursor: pointer; }
.field-row input[type="text"]:focus, .field-row select:focus, .field-row input[type="number"]:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}
.transparent-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ink2);
  cursor: pointer;
  padding: 4px 0;
}
.transparent-check input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.btn-action {
  background: var(--ink);
  color: var(--bg-soft);
  border: none;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s ease;
}
.btn-action:hover { background: var(--accent); }
.btn-action.full { display: block; width: 100%; }
.btn-action.sub {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-action.sub:hover {
  background: var(--ink);
  color: var(--bg-soft);
}

.label {
  font-size: 0.74rem;
  color: var(--ink2);
  margin-top: 14px;
  margin-bottom: 5px;
  letter-spacing: 0.03em;
  font-weight: 500;
}
.control {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  padding: 7px 10px;
  font-size: 0.8rem;
  display: flex; justify-content: space-between; align-items: center;
}
.control .v { color: var(--ink2); font-family: ui-monospace, monospace; font-size: 0.78rem; }
input[type="range"] {
  width: 100%;
  margin-top: 4px;
  accent-color: var(--accent);
}
.seg {
  display: grid;
  font-size: 0.74rem;
  border: 1px solid var(--border-soft);
}
.seg.col2 { grid-template-columns: 1fr 1fr; }
.seg.col4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.seg button {
  padding: 7px 0;
  text-align: center;
  border: none;
  border-right: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--ink2);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.74rem;
  transition: all 0.15s ease;
}
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--bg-warm); }
.seg button.on {
  background: var(--cat-edit);
  color: #fff;
  font-weight: 600;
}

/* === CENTER === */
.center {
  background: var(--bg-warm);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.preview-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}
.theme-toggle-row .label-txt {
  color: var(--ink3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.7rem;
}
.theme-toggle {
  display: flex;
  border: 1px solid var(--border-soft);
}
.theme-toggle button {
  background: var(--bg-card);
  border: none;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--ink2);
  cursor: pointer;
  border-right: 1px solid var(--border-soft);
}
.theme-toggle button:last-child { border-right: none; }
.theme-toggle button.on {
  background: var(--ink);
  color: var(--bg-soft);
  font-weight: 600;
}
.preview-main {
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    linear-gradient(45deg, #e8e0cc 25%, transparent 25%),
    linear-gradient(-45deg, #e8e0cc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8e0cc 75%),
    linear-gradient(-45deg, transparent 75%, #e8e0cc 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: var(--bg-soft);
  border: 1px dashed var(--border);
  min-height: 240px;
  transition: all 0.25s ease;
}
.preview-stage.dark .preview-main {
  background:
    linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #1a1818;
  border-color: #333;
}
.preview-stage.dark .sizes-bar {
  background: #1a1818;
  border-color: #333;
}
.preview-stage.dark .size-prev .lbl {
  color: #888;
}
.preview-stage.dark .size-prev canvas {
  border-color: #333;
}
.preview-stage.dark .mock-card {
  background: #1a1818;
  border-color: #333;
  color: #ccc;
}
.preview-stage.dark .mock-card .mock-title {
  color: #888;
}
.preview-stage.dark .mock-browser { background: #292a2d; }
.preview-stage.dark .mock-browser .tab {
  background: #202124;
  color: #e8eaed;
}
.preview-stage.dark .mock-google {
  background: #202124;
  color: #bdc1c6;
}
.preview-stage.dark .mock-google .title {
  color: #8ab4f8;
}

.preview-main canvas {
  max-width: 256px;
  max-height: 256px;
  width: 192px;
  height: 192px;
  image-rendering: -webkit-optimize-contrast;
}

.sizes-bar {
  display: flex; gap: 14px; align-items: flex-end; justify-content: center;
  padding: 16px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.size-prev {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.size-prev canvas {
  image-rendering: pixelated;
  border: 1px solid var(--border-soft);
}
.size-prev .lbl {
  font-size: 0.7rem; color: var(--ink3);
  font-family: ui-monospace, monospace;
}

.mocks-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mock-card {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
}
.mock-card .mock-title {
  font-size: 0.7rem;
  color: var(--ink3);
  letter-spacing: 0.05em;
}

/* Browser tab mock */
.mock-browser {
  width: 100%;
  background: #dadce0;
  border-radius: 4px 4px 0 0;
  padding: 4px 4px 0 4px;
}
.mock-browser .tab {
  background: #ffffff;
  border-radius: 4px 4px 0 0;
  padding: 4px 8px;
  display: flex; align-items: center; gap: 4px;
  font-size: 0.65rem;
  color: #3c4043;
}
.mock-browser .tab canvas, .mock-browser .tab .icon-slot {
  width: 14px; height: 14px;
  background: transparent;
}

/* iPhone */
.mock-iphone {
  width: 64px; height: 100px;
  background: #1a1818;
  border-radius: 10px;
  padding: 6px 4px;
  position: relative;
}
.mock-iphone::before {
  content: "";
  position: absolute;
  top: 2px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 4px;
  background: #000;
  border-radius: 0 0 4px 4px;
}
.mock-iphone .ios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 14px;
  padding: 0 4px;
}
.mock-iphone .ios-app {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #4a90e2, #2c5aa0);
  border-radius: 8px;
}
.mock-iphone .ios-app.featured canvas, .mock-iphone .ios-app.featured .icon-slot {
  width: 100% !important;
  height: 100% !important;
  border-radius: 8px;
}
.mock-iphone .ios-app.featured {
  background: transparent;
  padding: 0;
  overflow: hidden;
}

/* Android */
.mock-android {
  width: 64px; height: 100px;
  background: #2b2b2b;
  border-radius: 8px;
  padding: 4px;
  position: relative;
}
.mock-android .and-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  margin-top: 6px;
}
.mock-android .and-app {
  aspect-ratio: 1;
  background: #d2691e;
  border-radius: 50%;
}
.mock-android .and-app.featured {
  background: transparent;
  overflow: hidden;
  border-radius: 50%;
}
.mock-android .and-app.featured canvas, .mock-android .and-app.featured .icon-slot {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
}

/* Google search */
.mock-google {
  width: 100%;
  background: #ffffff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  color: #4d5156;
  text-align: left;
  border: 1px solid #dadce0;
}
.mock-google .url-row {
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 3px;
}
.mock-google .url-row canvas, .mock-google .url-row .icon-slot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: transparent;
}
.mock-google .title {
  color: #1a0dab;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
}

/* === RIGHT === */
.check-list {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.8rem;
}
.check-item {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  padding: 7px 9px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.check-item:hover { background: var(--bg-warm); }
.check-item input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--cat-output);
  cursor: pointer;
}
.check-item .name { color: var(--ink); flex: 1; }
.check-item .size {
  color: var(--ink3);
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
}
.check-item.custom-size .name { font-style: italic; }
.check-item .remove-x {
  background: transparent;
  border: none;
  color: var(--bad);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 4px;
  margin-left: 4px;
}
.check-item .remove-x:hover { color: var(--ink); }

.info-note {
  background: rgba(106, 124, 154, 0.10);
  border-left: 3px solid var(--cat-preview);
  padding: 8px 10px;
  font-size: 0.75rem;
  color: var(--ink2);
  line-height: 1.55;
  margin-top: 6px;
}
.info-note .ic { color: var(--cat-preview); font-weight: 700; }
.info-note strong { color: var(--ink); }

.custom-size-row {
  display: flex; gap: 6px; align-items: center;
  margin-top: 8px;
}
.custom-size-row input[type="number"] {
  width: 70px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  padding: 6px 8px;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  text-align: center;
  color: var(--ink);
}
.custom-size-row .unit {
  font-size: 0.78rem;
  color: var(--ink3);
}
.custom-size-row button {
  flex: 1;
  background: var(--cat-output);
  color: #fff;
  border: none;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
}
.custom-size-row button:hover { filter: brightness(0.9); }
.custom-size-row .format-seg {
  display: flex; gap: 2px;
}
.custom-size-row .format-seg button {
  flex: none;
  padding: 6px 8px;
  background: var(--bg-card);
  color: var(--ink2);
  border: 1px solid var(--border-soft);
}
.custom-size-row .format-seg button.on {
  background: var(--ink);
  color: var(--bg-soft);
  border-color: var(--ink);
}

.code-box {
  background: #2a2218;
  color: #d8c9a8;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.7rem;
  padding: 12px 14px;
  margin-top: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 3px 9px;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: inherit;
}
.copy-btn:hover { background: var(--accent-hov); }

.final-btn {
  display: block; width: 100%;
  background: var(--ink);
  color: var(--bg-soft);
  border: none;
  padding: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}
.final-btn:hover { background: var(--accent); }
.final-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
  color: var(--ink3);
}
.secondary-btn {
  display: block; width: 100%;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 9px;
  text-align: center;
  font-size: 0.82rem;
  margin-top: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.secondary-btn:hover {
  background: var(--ink);
  color: var(--bg-soft);
}

/* === セキュリティ・プライバシー方針 === */
.security-section {
  background: var(--bg);
  padding: 50px 24px 60px;
  border-top: 1px solid var(--border);
}
.security-inner {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--good);
  padding: 30px 36px;
}
.security-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.security-head .lock-icon { font-size: 1.9rem; line-height: 1; }
.security-head h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.55rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 3px;
}
.security-head .sub { color: var(--ink2); font-size: 0.86rem; }

.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.security-item {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  padding: 14px 16px;
}
.security-item .sec-icon { font-size: 1.4rem; margin-bottom: 5px; line-height: 1; }
.security-item h4 {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 5px;
}
.security-item p { font-size: 0.8rem; color: var(--ink2); line-height: 1.65; }
.security-item p strong {
  color: var(--ink);
  background: var(--accent-soft);
  padding: 0 4px;
  font-weight: 600;
}
.security-promise {
  margin-top: 20px;
  padding: 16px 22px;
  background: var(--bg-warm);
  border-left: 4px solid var(--accent);
  font-size: 0.88rem;
  color: var(--ink2);
  line-height: 1.8;
}
.security-promise .label {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 3px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-right: 10px;
  vertical-align: 1px;
}

/* === Footer === */
.app-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  text-align: center;
  color: var(--ink3);
  font-size: 0.82rem;
}
.app-footer .links {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.app-footer .links a {
  color: var(--ink2);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.15s ease;
}
.app-footer .links a:hover { color: var(--accent); }
.app-footer .copyright { font-size: 0.78rem; }

/* === Toast === */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}
.toast {
  background: var(--ink);
  color: var(--bg-soft);
  padding: 10px 18px;
  font-size: 0.85rem;
  animation: toast-in 0.3s ease;
  max-width: 320px;
}
.toast.error { background: var(--bad); }
.toast.success { background: var(--good); }
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* responsive */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .col { min-height: auto; }
}
@media (max-width: 600px) {
  .app-header { padding: 10px 14px; }
  .app-h1 { font-size: 1.15rem; }
  .header-link { font-size: 0.85rem; }
  .center { padding: 16px; }
  .preview-stage { padding: 14px; }
  .mocks-row { grid-template-columns: 1fr 1fr; }
  .sizes-bar { gap: 8px; }
}