/* Settings workspace: one category and one editor section at a time. */
#view-pengaturan { overflow: hidden; }
.settings-page { height: 100%; display: flex; flex-direction: column; }
.settings-heading { padding: 25px 28px 22px; flex: none; border-bottom: 1px solid var(--line); }
.settings-heading h1 { margin: 0; font-size: 23px; letter-spacing: -.025em; line-height: 1.3; }
.settings-heading p { margin: 5px 0 0; color: var(--fg-muted); font-size: 12px; }
.settings-workspace { display: flex; flex: 1; min-height: 0; }
.settings-nav { width: 196px; flex: none; padding: 25px 14px; border-right: 1px solid var(--line); background: var(--surface-2); }
.settings-nav-label { display: block; padding: 0 12px 13px; font-size: 9px; letter-spacing: .12em; font-weight: 700; color: var(--fg-muted); }
.settings-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; margin-bottom: 5px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-muted); font-size: 12px; font-weight: 550; text-align: left; cursor: pointer; }
.settings-nav button:hover { background: var(--surface-3); color: var(--fg); }
.settings-nav button[aria-selected=true] { background: var(--accent-soft); color: var(--accent); }
.settings-nav .ico { width: 17px; height: 17px; flex: none; }
.settings-draft-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-left: auto; flex: none; }
.settings-content { flex: 1; min-width: 0; min-height: 0; }
.settings-content > .panel-card { height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.settings-panel-heading, .editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 28px; border-bottom: 1px solid var(--line); flex: none; }
.settings-panel-heading h2, .editor-heading h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 650; letter-spacing: -.02em; }
.settings-panel-heading p, .editor-heading p { margin: 5px 0 0; color: var(--fg-muted); font-size: 12px; }
.settings-panel-heading .btn { font-size: 12px; flex: none; }
.settings-panel-body { padding: 24px 28px; overflow-y: auto; min-height: 0; flex: 1; }
.settings-panel-body h3, .editor-section-heading h3 { font-size: 14px; margin: 0; font-weight: 650; }
.settings-form { max-width: 660px; }
.account-form { max-width: 420px; }
.settings-form input, .settings-form textarea { font-size: 13px; }
.settings-form .inline-check { display: flex; margin-top: 18px; }
.settings-form .save-row { gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.settings-form .err-inline { margin: 10px 0 0; }
.settings-list-heading { display: flex; align-items: center; margin-bottom: 12px; }
.field-description { font-size: 12px; color: var(--fg-muted); line-height: 1.7; margin: 6px 0 20px; }
.settings-panel-body > .field-hint { margin-top: 22px; }
.settings-panel-body .member { padding: 16px 0; flex-wrap: wrap; }
.settings-panel-body .member .acts { flex-wrap: wrap; }
.settings-panel-body .member .nm { overflow-wrap: anywhere; }
#cannedList { overflow-x: auto; }
#cannedList table { table-layout: fixed; }
#cannedList th:first-child { width: 17%; }
#cannedList th:nth-child(2) { width: 23%; }
#cannedList th:last-child { width: 48px; }
#cannedList td { overflow-wrap: anywhere; padding-top: 16px; padding-bottom: 16px; }
#cannedList .muted { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 32px 20px; text-align: center; }

/* Widget editor keeps the preview and save actions in view. */
.editor-status { font-size: 11px; white-space: nowrap; padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--fg-muted); background: var(--surface-2); }
.editor-status.draft { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.editor-layout { display: grid; grid-template-columns: minmax(330px, .85fr) minmax(340px, 1.15fr); flex: 1; min-height: 0; min-width: 0; }
.editor-controls { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.editor-tabs { display: flex; padding: 0 18px; border-bottom: 1px solid var(--line); gap: 17px; overflow-x: auto; flex: none; scrollbar-width: thin; }
.editor-tabs button { font-size: 11px; font-weight: 550; white-space: nowrap; padding: 16px 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--fg-muted); cursor: pointer; }
.editor-tabs button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.editor-scroll { padding: 24px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; flex: 1; }
.editor-controls fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.editor-controls fieldset:disabled { opacity: .6; }
.editor-section-heading { margin-bottom: 22px; }
.editor-section-heading p { margin: 5px 0 0; color: var(--fg-muted); font-size: 11px; line-height: 1.6; }
.editor-section-label { font-size: 11px; font-weight: 600; color: var(--fg-muted); margin-bottom: 10px; }
.widget-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.widget-presets button { padding: 9px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; text-align: left; cursor: pointer; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.widget-presets button.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.widget-presets strong { display: block; font-size: 11px; font-weight: 650; margin-top: 6px; }
.preset-description { display: block; font-size: 10px; color: var(--fg-muted); line-height: 1.5; margin-top: 1px; }
.preset-sample { height: 44px; border-radius: 5px; background: var(--surface-2); position: relative; display: block; border: 1px solid var(--line); overflow: hidden; }
.preset-sample:before { content: ''; display: block; height: 12px; background: var(--preset); opacity: .85; }
.preset-sample i, .preset-sample b { display: block; position: absolute; height: 5px; background: var(--line-strong); border-radius: 3px; left: 8px; top: 20px; width: 35%; }
.preset-sample b { top: 30px; width: 54%; }
.preset-sample em { position: absolute; right: 8px; bottom: 7px; width: 12px; height: 12px; border-radius: 4px; background: var(--preset); }
.preset-sample.dark { background: #182130; }
.editor-fields label { font-size: 11px; margin: 16px 0 6px; color: var(--fg-muted); font-weight: 600; }
.editor-fields > label:first-child { margin-top: 0; }
.editor-fields input:not([type=checkbox]):not([type=color]), .editor-fields select, .editor-fields textarea { width: 100%; min-width: 0; font-size: 12px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); outline: none; }
.editor-fields select { color-scheme: light; }
.editor-fields textarea { margin-top: 0; resize: vertical; }
.editor-fields input:focus, .editor-fields select:focus, .editor-fields textarea:focus { border-color: var(--accent); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-control { display: flex; align-items: center; gap: 8px; }
.color-control input[type=color] { width: 38px; height: 38px; border: 1px solid var(--line-strong); padding: 3px; border-radius: 8px; cursor: pointer; background: var(--surface); flex: none; }
.color-control #eAccentHex { width: 87px; font-family: ui-monospace, monospace; }
.color-control span { font-size: 10px; color: var(--fg-muted); line-height: 1.4; }
.field-hint { font-size: 11px; line-height: 1.6; color: var(--fg-muted); margin: 7px 0 0; }
.editor-fields .editor-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 6px; font-size: 12px; cursor: pointer; }
.editor-switch input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.editor-preview { display: flex; flex-direction: column; background: var(--surface-2); border-left: 1px solid var(--line); padding: 20px; min-width: 0; min-height: 0; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; font-weight: 600; flex: none; }
.preview-devices, .editor-mobile-switch { display: flex; padding: 3px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; }
.preview-devices button, .preview-scenes button, .editor-mobile-switch button { border: 0; background: transparent; color: var(--fg-muted); font: inherit; font-size: 11px; border-radius: 6px; padding: 7px 11px; cursor: pointer; }
.preview-devices button.selected, .editor-mobile-switch button.selected { color: var(--fg); background: var(--surface-3); }
.preview-scenes { display: flex; justify-content: center; gap: 2px; margin: 14px 0 10px; flex-wrap: wrap; flex: none; }
.preview-scenes button.selected { color: var(--accent); background: var(--accent-soft); }
.preview-stage { flex: 1; min-height: 0; min-width: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; background: radial-gradient(var(--line-strong) .75px, transparent .75px) 0 0 / 16px 16px; }
.preview-viewport { position: relative; flex: none; overflow: hidden; border-radius: 12px; box-shadow: 0 12px 34px #142b5426; background: #edf1f6; }
.preview-viewport iframe { position: absolute; top: 0; left: 0; transform-origin: top left; border: 0; display: block; }
.preview-caption { text-align: center; font-size: 10px; line-height: 1.5; color: var(--fg-muted); margin: 10px 0 0; flex: none; }
.editor-savebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.editor-savebar > div:first-child { min-width: 0; font-size: 11px; color: var(--fg-muted); }
.editor-savebar .err-inline { display: block; margin: 4px 0 0; }
.editor-savebar .saved { display: block; margin: 2px 0 0; font-size: 11px; }
.editor-savebar .saved:not(.show) { display: none; }
.editor-save-actions { display: flex; gap: 8px; flex: none; }
.editor-save-actions .btn { font-size: 11px; padding: 10px 13px; white-space: nowrap; }
.editor-save-actions #saveWelcome { font-weight: 650; }
.editor-mobile-switch { display: none; }
.settings-page button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (prefers-color-scheme: dark) { .editor-fields select { color-scheme: dark; } }
@media (max-width: 1200px) {
  .settings-nav { width: 172px; padding: 22px 10px; }
  .editor-layout { grid-template-columns: minmax(315px, 1fr) minmax(290px, 1fr); }
  .editor-tabs { gap: 13px; padding: 0 16px; }
  .editor-scroll, .editor-preview { padding: 18px; }
  .editor-savebar { padding: 14px 18px; }
  #widgetSaveHint { display: none; }
}
@media (max-width: 960px) {
  .settings-workspace { flex-direction: column; }
  .settings-nav { width: auto; display: flex; padding: 8px 18px; gap: 6px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .settings-nav-label { display: none; }
  .settings-nav button { width: auto; flex: none; margin: 0; padding: 10px 12px; white-space: nowrap; }
  .settings-heading { padding: 18px 24px; }
  .settings-panel-body .member .acts { width: 100%; padding-left: 42px; }
}
@media (max-width: 740px) {
  .settings-heading { padding: 16px 18px; }
  .settings-heading h1 { font-size: 20px; }
  .settings-heading p { display: none; }
  .settings-nav { padding: 8px 10px; }
  .settings-nav button { padding: 9px 8px; font-size: 11px; gap: 7px; flex: 1 0 auto; justify-content: center; }
  .settings-nav .ico { display: none; }
  .settings-panel-heading, .editor-heading { padding: 17px 18px; align-items: flex-start; }
  .settings-panel-heading { flex-wrap: wrap; }
  .settings-panel-heading h2, .editor-heading h2 { font-size: 16px; }
  .editor-heading p { display: none; }
  .settings-panel-body { padding: 20px 18px; }
  .editor-mobile-switch { display: flex; margin: 0 18px 12px; flex: none; }
  .editor-mobile-switch button { flex: 1; }
  .editor-heading { border-bottom: 0; }
  .editor-layout { display: flex; flex-direction: column; }
  .editor-controls { flex: 1; }
  .editor-preview { display: none; flex: 1; border-left: 0; border-top: 1px solid var(--line); padding: 14px; }
  .widget-editor[data-editor-view=preview] .editor-controls { display: none; }
  .widget-editor[data-editor-view=preview] .editor-preview { display: flex; }
  .editor-tabs { justify-content: space-between; }
  .editor-scroll { padding: 20px 18px; }
  .editor-savebar { padding: 12px; display: block; }
  .editor-savebar > div:first-child:has(.err-inline:not(:empty)), .editor-savebar > div:first-child:has(.saved.show) { margin-bottom: 10px; }
  .editor-save-actions { gap: 6px; justify-content: flex-end; }
  .editor-save-actions .btn { padding: 10px 8px; font-size: 10px; }
  .editor-save-actions #saveWelcome { flex: 1; }
}
@media (max-height: 600px) and (min-width: 741px) {
  .settings-heading { padding-top: 12px; padding-bottom: 12px; }
  .editor-heading { padding-top: 14px; padding-bottom: 14px; }
  .editor-savebar { padding-top: 10px; padding-bottom: 10px; }
}
