:root {
  --h5c3-primary: #0f5eb8;
  --h5c3-primary-hover: #0c4f9b;
  --h5c3-bg: #f5f7fa;
  --h5c3-surface: #ffffff;
  --h5c3-border: #d7dee7;
  --h5c3-border-soft: #eaf0f5;
  --h5c3-text: #182433;
  --h5c3-muted: #607084;
  --h5c3-success: #157347;
  --h5c3-error: #b42318;
  --h5c3-radius: 5px;
  --h5c3-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.h5c3-tool {
  color: var(--h5c3-text);
  font:
    400 15px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  width: 100%;
}

.h5c3-tool [hidden] {
  display: none !important;
}

.h5c3-tool__toolbar {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: 5px 0 0;
  min-height: 32px;
  padding: 8px 10px;
  width: 100%;
}

.h5c3-tool__bottom-ad {
  margin-top: 14px;
  min-height: 90px;
}

.h5c3-tool__panel {
  background: var(--h5c3-surface);
  border: 1px solid var(--h5c3-border);
  border-radius: var(--h5c3-radius);
  box-shadow: var(--h5c3-shadow);
  min-height: 100%;
  padding: 10px;
}

.h5c3-tool__panel-head {
  align-items: center;
  border-bottom: 1px solid var(--h5c3-border-soft);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.h5c3-tool__panel-meta {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.h5c3-tool__panel-title {
  color: var(--h5c3-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.h5c3-tool__panel-state {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--h5c3-border-soft);
  border-radius: 999px;
  color: var(--h5c3-muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  min-height: 22px;
  padding: 0 8px;
}

.h5c3-tool__panel-state.is-ready {
  background: #eef7f1;
  border-color: #cfe7d7;
  color: var(--h5c3-success);
}

.h5c3-tool__label {
  color: var(--h5c3-text);
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.h5c3-tool__fields,
.h5c3-tool__controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.h5c3-tool__controls {
  margin-top: 12px;
}

.h5c3-tool__control--full {
  grid-column: 1 / -1;
}

.h5c3-tool__textarea,
.h5c3-tool__input,
.h5c3-tool__select,
.h5c3-tool__color,
.h5c3-tool__output-box {
  width: 100% !important;
  background: #ffffff;
  border: 1px solid var(--h5c3-border) !important;
  border-radius: var(--h5c3-radius) !important;
  color: var(--h5c3-text);
  box-sizing: border-box;
}

.h5c3-tool__textarea,
.h5c3-tool__output-box {
  height: 60vh;
  max-height: 60vh;
  min-height: 60vh;
  overflow: auto;
  padding: 14px;
  font:
    400 13px/1.65 Consolas,
    Monaco,
    "Courier New",
    monospace;
  resize: none;
}

.h5c3-tool__input,
.h5c3-tool__select,
.h5c3-tool__color {
  min-height: 32px;
}

.h5c3-tool__input,
.h5c3-tool__select {
  font-size: 12px;
  padding: 0 10px !important;
}

.h5c3-tool__color {
  cursor: pointer;
  padding: 2px;
}

.h5c3-tool__textarea::placeholder,
.h5c3-tool__input::placeholder {
  color: #94a3b8;
}

.h5c3-tool__textarea.is-drop-active {
  background: #f8fbff;
  border-color: var(--h5c3-primary);
  outline: 2px solid rgba(15, 94, 184, 0.08);
}

.h5c3-tool__textarea:focus,
.h5c3-tool__input:focus,
.h5c3-tool__select:focus,
.h5c3-tool__color:focus {
  border-color: var(--h5c3-primary) !important;
  outline: 2px solid rgba(15, 94, 184, 0.1);
}

.h5c3-tool__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 0;
}

.h5c3-tool__button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  min-height: 32px;
  padding: 0 11px;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.h5c3-tool__button--primary {
  background: var(--h5c3-primary);
  color: #fff;
}

.h5c3-tool__button--primary:hover {
  background: var(--h5c3-primary-hover);
}

.h5c3-tool__button--secondary,
.h5c3-tool__button--ghost {
  background: #ffffff;
  border-color: var(--h5c3-border);
  color: var(--h5c3-text);
}

.h5c3-tool__button--secondary:hover,
.h5c3-tool__button--ghost:hover {
  background: #f9fbfc;
}

.h5c3-tool__button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.h5c3-tool__download-button {
  min-height: 24px;
  padding: 0 9px;
}

.h5c3-tool__message {
  color: var(--h5c3-muted);
  font-size: 12px;
  min-width: 0;
  text-align: right;
}

.h5c3-tool__message.is-error {
  color: var(--h5c3-error);
}

.h5c3-tool__message.is-success {
  color: var(--h5c3-success);
}

.h5c3-tool__panel--result {
  min-height: 100%;
}

.h5c3-tool__result-stage {
  display: flex;
  flex: 1 1 auto;
  min-height: 300px;
}

.h5c3-tool__result-ad,
.h5c3-tool__result-output {
  flex: 1 1 auto;
  height: auto;
  width: 100%;
}

.h5c3-tool__ad-slot,
.h5c3-tool__result-ad {
  min-height: 300px;
  width: 100%;
}

.h5c3-tool__result-output {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.h5c3-tool__output-box {
  background: #fbfcfe;
  border-color: #dbe3ec;
  flex: 1 1 auto;
  margin: 0;
  white-space: pre;
}

.h5c3-tool__status-pass {
  color: var(--h5c3-success);
  font-weight: 700;
}

.h5c3-tool__status-fail {
  color: var(--h5c3-error);
  font-weight: 700;
}

.h5c3-tool__preview {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
}

.h5c3-tool__preview-box {
  background-color: #ffffff;
  border: 1px solid var(--h5c3-border);
  border-radius: var(--h5c3-radius);
  height: 150px;
  max-width: 150%;
  overflow: visible;
  position: relative;
  width: 150px;
}

.h5c3-tool__preview-box[data-preview-kind="shadow"] {
  background: #f5f7fa;
  border-color: var(--h5c3-border-soft);
}

.h5c3-tool__preview-box[data-preview-kind="shadow"]::after {
  background: #ffffff;
  border: 1px solid rgba(215, 222, 231, 0.9);
  border-radius: 10px;
  box-shadow: var(--h5c3-preview-shadow, none);
  content: "";
  height: 100px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
}

.h5c3-tool[data-tool="css-gradient-generator"] .h5c3-tool__result-output,
.h5c3-tool[data-tool="box-shadow-generator"] .h5c3-tool__result-output {
  height: 60vh;
  max-height: 60vh;
  min-height: 60vh;
}

.h5c3-tool[data-tool="css-gradient-generator"] .h5c3-tool__output-box,
.h5c3-tool[data-tool="box-shadow-generator"] .h5c3-tool__output-box {
  height: 100px;
  max-height: 150px;
  min-height: 0;
}
